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

Fix for schema inclusion loop #10

Closed lobatt closed 9 years ago

lobatt commented 9 years ago

This is a fix for https://github.com/metaleap/go-xsd/issues/9

Plus https://github.com/lobatt/go-xsd/commit/e3f303b5dac188482dba2c1a0dc0cf35cc8ff21b is for a minor fix that some nested complex type not generating safe identifier. example below:

                  <xs:element name="SCTE-35DistributionRestrictions" minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>Accommodates the 2012 revision to SCTE-35 that adds distribution bits. (v3.0)</xs:documentation>
                        </xs:annotation>
                        <xs:complexType>
                            <xs:complexContent>
                                <xs:extension base="SCTE-35DistributionRestrictions">
                                    <xs:attribute name="tierLevel">
                                        <xs:annotation>
                                            <xs:documentation>Signals receivers whether or not to pass the SCTE-35 message.</xs:documentation>
                                        </xs:annotation>
                                        <xs:simpleType>
                                            <xs:restriction base="xs:nonNegativeInteger">
                                                <xs:minInclusive value="0"/>
                                                <xs:maxInclusive value="4096"/>
                                            </xs:restriction>
                                        </xs:simpleType>
                                    </xs:attribute>
                                </xs:extension>
                            </xs:complexContent>
                        </xs:complexType>
                    </xs:element>