hxt
hxt copied to clipboard
XML schema data types in hxt-relaxng don't support constants
Take this schema and call it integer.rng
:
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<choice>
<element name="test1">
<data type="integer" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
</element>
<element name="test2">
<value type="integer" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">4</value>
</element>
</choice>
</start>
</grammar>
The instance <test1>4</test1>
validates perfectly, while equally valid <test2>4</test2>
doesn't.
The problem appears to be in function datatypeEqualW3C
in module DataTypeLibW3C. The data-type map norm
in there is either used in a wrong way, or it should map all missing entries to id
like it does for string
.