metaleap / go-xsd

[stable since 2013] a lib for loading XML Schema Definition (XSD) files ➜ plus, a tool `makepkg` to code-generate from any *.xsd your Go package with all needed `struct`s to readily `xml.Unmarshal()` documents into, based on the XSD's schema definitions. NOT REALLY MAINTAINED FOR YEARS NOW: try the forks if running into issues.
http://www.reddit.com/r/golang/comments/12g6sl/is_there_a_tool_that_generates_go_source_code_for/
MIT License
216 stars 66 forks source link

Undefined has attribute error. #34

Open stephendparker opened 6 years ago

stephendparker commented 6 years ago

Great library - thanks for the work! When I try to generate a go file from an XSD, I get a error compiling the file:

assets\model\items.xsd_go\items.xsd.go:430: undefined: XsdGoPkgHasAttr_Uniquename

on this code block generated:


type XsdGoPkgHasAtts_ItemBase struct {
    XsdGoPkgHasAttr_Uniquename

    XsdGoPkgHasAttr_Tier_Ttiernumber_

    XsdGoPkgHasAttr_Unlockedtocraft_XsdtBoolean_False

    XsdGoPkgHasAttr_Foodcategory

}

XSD file: https://www.dropbox.com/s/6lwj4maomah7pn0/items.xsd?dl=0 GO file: https://www.dropbox.com/s/lqy97t53tmxwvir/items.xsd.go?dl=0 XML file: https://www.dropbox.com/s/zcqdvrypmv9jflz/items.xml?dl=0

metaleap commented 6 years ago

Regrettably I have really let this package "bit-rot" a bit over the years (thanks to not having had to work with any XMLs/XSDs for years), that is, I let all maintenance and bug hunting fall by the wayside. Ideally I'd "one of these days" get in touch with its major forkers to see whether existing fixes out-there (if any) can be re-consolidated into the master.

Hopefully between x-mas and new-years I might finally find the leisure+quiet to bring this whole package up to speed.

In the meantime, if time is of the essence I'd suggest to check out which of the dozens of forks have had actual changes made to them and/or found a number of starrers/followers/watchers. These might be the candidates to try in-place of this original repo and see if they do not cause the same issue.