highsource / highsource/jsonix-schema-compiler
leading and trailing space in element name
- Dominant language
- Java
- Stars
- 138
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
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 :
``` javascript
element = this.document.createElementNS(namespaceURI, qualifiedName);
```
because `qualifiedName` ends with a space.
According to the [XSD spec](http://www.w3.org/TR/2004/REC-xml11-20040204/#AVNormalize) :
> 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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.