UNC-Libraries / jquery.xmleditor

jQuery based XML editor plugin.
153 stars 71 forks source link

xsd2json: Element definitions with no referenced or included type #68

Closed vog closed 7 years ago

vog commented 7 years ago

The following valid XML schema:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.com/foo" elementFormDefault="qualified">
  <xs:element name="Foo"/>
</xs:schema>

produces the following error message:

TypeError: node is undefined

The relevant section of the XML Schema standard is:

https://www.w3.org/TR/xmlschema11-1/#declare-element

An <element> with no referenced or included type definition will correspond to an element declaration which has the same type definition as the first substitution-group head named in the substitutionGroup [attribute], if present, otherwise xs:anyType.