Skip to content

XSD Schema Parse Error with namespaced attributes #4

@admonkey

Description

@admonkey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions