I was trying to declare an element with a mandatory
soap:mustUnderstand="1" attribute, like so:
<attribute ref="soap:mustUnderstand" use="required" fixed="1"/>
I get the following error when parsing the schema from Xerces 2.6.2:
Value 'true' is not facet-valid with respect to pattern '0|1'
But my .xsd doesn't say "true" anywhere -- it says "1".
This was in the context of a schema that referenced SOAP, but I boiled
it down to the following trivial example:
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://example.com"
targetNamespace="http://example.com">
<attribute name="mustUnderstand" >
<simpleType>
<restriction base='boolean'>
<pattern value='0|1' />
</restriction>
</simpleType>
</attribute>
<element name="Test">
<complexType>
<attribute ref="tns:mustUnderstand" use="required" fixed="1"/>
</complexType>
</element>
</schema>
Then we get the following error from the XMLGrammarBuilder sample:
$ java xni.XMLGrammarBuilder -f -a test-default.xsd
[Error] test-default.xsd:16:69: cvc-pattern-valid: Value 'true' is not
facet-valid with respect to pattern '0|1' for type 'null'.
[Error] test-default.xsd:16:69: a-props-correct.2: Invalid value
constraint value '1' in attribute 'mustUnderstand'.
If I change each "1" to "true", and each "0" to "false", this works
fine and has the desired effect.
This seems to be a bug in Xerces. I didn't see anything like it in
Jira. Has anyone run into this before?
Thanks,
Steve
--
Steven C. Ihde <sihde@xxxxxxxxxxxxxxx>
PGP Key ID: 0x7793756D
PGP Fingerprint: DC 55 8B CA 50 8B DD 75 67 45 96 4D FF 42 8A 6C
|