XML-Schema-learner
XML-Schema-learner copied to clipboard
XSD Schema Parse Error with namespaced attributes
When I generate the XSD using this sample xml (renamed to sample.xml.txt
for github's uploader)
./schema-learn -t xsd simple.xml > simple.xsd
Then try to validate it with xmllint
xmllint --noout --schema simple.xsd simple.xml
I get schema parser errors failing to compile
simple.xsd:33: element attribute: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute', attribute 'name': 'dmd:lastModified' is not a valid value of the atomic type 'xs:NCName'.
simple.xsd:34: element attribute: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute', attribute 'name': 'dmd:startDate' is not a valid value of the atomic type 'xs:NCName'.
simple.xsd:46: element attribute: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}attribute', attribute 'name': 'dmd:surveyId' is not a valid value of the atomic type 'xs:NCName'.
simple.xsd:50: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))).
WXS schema simple.xsd failed to compile
I think it has something to do with the namespaced attributes.