Open
Description
I have the following xsd schema which fails.
<xsd:simpleType name="emptyType" >
<xsd:restriction base="xsd:string">
<xsd:length value="0" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="empty-or-decimal">
<xsd:union memberTypes="xsd:decimal emptyType" />
</xsd:simpleType>
<xsd:simpleType name="empty-or-integer">
<xsd:union memberTypes="xsd:integer emptyType" />
</xsd:simpleType>
Expected result would probably be:
<dataset value=''/> -> {'value': ''}
<dataset value='1'/> -> {'value': 1}
To get it working at all I changed validator.js (line 387) from:
else if (value.value) {
to:
else if (value.value !== undefined && value.value !== null) {
Another issue had something to do with namespacing which I don't really understand. Somehow my own type caused an assertion. To get around that I added (to the namespacedName function in the xsd.js file):
else if (self.targetNamespace) {
return '{' + self.targetNamespace + '}' + name;
}
If you could give me some feedback I would love to turn it into a pull request.
Metadata
Metadata
Assignees
Labels
No labels