droyo / go-xml

utility and code-generation libraries for XML
MIT License
304 stars 115 forks source link

complexType DetailedHashSum: could not find type "BinaryDataType" in namespace http://service.ddex.net/xml/avs/avs for element DataType #123

Closed imxyb closed 3 years ago

imxyb commented 4 years ago

i use your xsdgen to parse the ddex xsd, but occur this error, can you help me to solve it?

the xsd link: http://service.ddex.net/xml/ern/41/release-notification.xsd

thanks.

imxyb commented 4 years ago

cmd:

xsdgen -vv ~/Desktop/release-notification.xsd ~/Desktop/avs.xsd
read /Users/imxyb/Desktop/release-notification.xsd
read /Users/imxyb/Desktop/avs.xsd
setting namespaces to ["http://ddex.net/xml/ern/41" "http://ddex.net/xml/avs/avs"]
complexType Video: could not find type "CompositeMusicalWorkType" in namespace http://ddex.net/xml/avs/avs for element CompositeMusicalWorkType
droyo commented 4 years ago

I'm not sure you got the right avs.xsd. The schema you shared has

<xs:import namespace="http://ddex.net/xml/avs/avs" schemaLocation="http://ddex.net/xml/avs/avs4.xsd"/>

Which contains the CompositeMusicalWorkType definition. I downloaded http://ddex.net/xml/avs/avs4.xsd and ran your command and it generated output that looks OK (https://gist.github.com/droyo/a1da9e8318270a5d1a14155d92be64f3). Here's the code for the type mentioned in the error:

// May be one of Medley, Neither, Potpourri
type CompositeMusicalWorkType string
droyo commented 3 years ago

Please re-open if you still have an issue