exec.Command(
"composite",
"-compose","Dst_Over",
"-tile","pattern:checkerboard",
`C:\go_project\src\parsing\2.png`,
`C:\go_project\src\parsing\test1.png`,
)
package main
import (
"encoding/xml"
"fmt"
)
type XMLShop struct {
XMLName xml.Name `xml:"shop"`
Name []NameField `xml:",any"`
Company string `xml:"company"`
Url string `xml:"url"`
}
type NameField struct {
XMLName xml.Name `xml:""`
Value string `xml:",chardata"`
}
const data = `
<shop>
<someOtherName>testname1</someOtherName>
<custom_name>testname2</custom_name>
<company>testcorp</company>
<url>http://ya.ru</url>
</shop>
`
func main() {
var shop XMLShop
if err := xml.Unmarshal([]byte(data), &shop); err != nil {
fmt.Println(err)
return
}
for _, node := range shop.Name {
if node.XMLName.Local == "custom_name" {
fmt.Printf("Name: %+v\n", node.Value)
}
}
}