[ 
https://issues.apache.org/jira/browse/XERCESC-1546?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Cantor updated XERCESC-1546:
----------------------------------
    Fix Version/s:     (was: Nightly build (please specify the date))
                   2.8.0

> length, maxLength, and minLength facets are applied to item instead of list 
> when value specific via default/fixed
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: XERCESC-1546
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1546
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Validating Parser (XML Schema)
>    Affects Versions: 2.7.0
>         Environment: any
>            Reporter: Boris Kolpackov
>            Priority: Major
>             Fix For: 2.8.0
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org

Reply via email to