Skip to content

leading and trailing space in element name #46

Open
@amarant

Description

@amarant

Hi,
I've got a schema with a trailing space in an element name, this is valid XSD, so when I test a round trip marshaling on it, it throws an error when marshaling back in the function writeStartElement when executing :

element = this.document.createElementNS(namespaceURI, qualifiedName);

because qualifiedName ends with a space.
According to the XSD spec :

If the attribute type is not CDATA, then the XML processor MUST further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by a single space (#x20) character.

I think it is the role of the schema compiler to trim the attribute name. So the mapping file would contain the trimmed names. But maybe a trim in the js part would be useful too.

Thanks for your great work on this library.

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