Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.7.0
-
None
-
any
Description
Consider the following scheme:
<?xml version="1.0" encoding="utf-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:t="test"
targetNamespace="test"
elementFormDefault="qualified">
<simpleType name="ListOfInts">
<list itemType="int"/>
</simpleType>
<simpleType name="int3">
<restriction base="t:ListOfInts">
<minLength value="3"/>
<maxLength value="3"/>
</restriction>
</simpleType>
<element name="root" type="t:int3" default="0 0 0"/>
</schema>
and instance:
<?xml version="1.0"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="test test.xsd"
xmlns="test">0 0 0</root>
Processing with dom_count results in the following error:
$ ./dom_count -v=always -n -s test.xml
Error at file /tmp/test.xsd, line 22, char 53
Message: Value '0' with length '1' is not equal to length facet of '3'
Seems like the validator applies minLength and maxLength facets to individual list items instead of to the list as a whole. This is also the case for the length facet and the fixed attribute instead of default. Interestingly, if we remove the default attribute from the schema everyhting works fine, even though the instance contains exactly the same value as the default attribute.
Attachments
Issue Links
- is duplicated by
-
XERCESC-1683 array default values wrongly cause xerces to reject schema
- Closed