Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes from main XSD not saved to XML and minor issue with remove_ns() #4

Open
M-casado opened this issue Feb 16, 2021 · 0 comments

Comments

@M-casado
Copy link

Hello, I have started using your xsd2xml tool (special thanks for your work), more specifically the updated branch from @seregagl, and I have encountered two main issues (being the second the one the most important, for which I have yet to find a fix). Since I am completely new to XSD syntax, they may sound simple and banal, for which I apologize.

  1. Function remove_ns() being passed "None" as "name". This causes the function to crash, trying to index None[0]. The following XSD attribute was the one causing the issue, although I am unsure why, since it was correctly validated by other XSD-checkers.
<xs:attribute name="match_edge">
      <xs:simpleType>
          <xs:restriction base="xs:string">
              <xs:enumeration value="full">
              </xs:enumeration>
              <xs:enumeration value="start">
              </xs:enumeration>
              <xs:enumeration value="end">
              </xs:enumeration>
          </xs:restriction>
      </xs:simpleType>
 </xs:attribute>
  1. Attributes that are defined within the main XSD are not saved to the output XML file. In this case some of the attributes from the XSD (first code block) were completely omitted in the output XML (second code block). Once again I am unsure why, and it was previously validated.
<xs:element name="FILES">
    <xs:complexType>
        <xs:sequence maxOccurs="1" minOccurs="1">
            <xs:element name="FILE" maxOccurs="unbounded">
              <xs:complexType>
                  <xs:attribute name="filename" type="xs:string" use="required">
                  </xs:attribute>
      </xs:complexType>
</xs:element>
<FILES>
      <FILE>
</FILE>
</FILES>

Other attributes from were correctly saved to the output XML, although in this case they were defined in a common space, instead of being directly specified within the said main XSD.

<xs:complexType name="NameType">
    <xs:simpleContent>
        <xs:extension base="xs:string">
            <xs:attribute name="label" use="optional" type="xs:string"/>
        </xs:extension>
    </xs:simpleContent>
</xs:complexType>
<TAG label="String">String</PRIMARY_ID>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant