コード例 #1
0
func parseWord3(needle string, arrayNode string, sectionNode string) [][]string {

	var tblResArray [][]string

	for _, tbl := range dataSelection {
		result := uscore.HasVal(tbl.(map[string]interface{}), needle)

		if !result {
			continue
		}

		rows := tbl.(map[string]interface{})["tr"].([]interface{})
		var cellsArray [][]string
		var ok bool

		for _, row := range rows {

			cellArr, arrOk := row.(map[string]interface{})["tc"].([]interface{})
			cellMap, mapOk := row.(map[string]interface{})["tc"].(map[string]interface{})

			if arrOk {
				cellsArray, ok = uscore.HasKey(cellArr, "", "", "t")
			} else if mapOk {
				cellsArray, ok = uscore.HasKey(cellMap, "", "", "t")
			} else {
				cellsArray, ok = [][]string{}, false
				continue
			}

			if ok {
				for _, d := range cellsArray {
					tblResArray = append(tblResArray, d)
				}
				//tblResArray = cellsArray
			}
		}
	}
	return tblResArray
}
コード例 #2
0
func parseWord2(needle string, arrayNode string, sectionNode string) [][]string {

	tblResArray = [][]string{}
	var instance []interface{}
	groups2 = instance

	for _, group := range dataSelection {

		result := uscore.HasVal(group.(map[string]interface{}), needle)

		if !result {
			continue
		}

		dataTypeSwitch2(group.(map[string]interface{})[arrayNode], sectionNode)

		tblResArray2, _ = uscore.HasKey(groups1, "tc", "", "t")
	}

	return tblResArray2
}