You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org> on 2016/07/22 08:55:20 UTC
[jira] [Updated] (XERCESJ-1559) the root instance element doesn't
validate via xsi:type reference if the type is a simpleType having an
assertion, and an element declaration is absent
[ https://issues.apache.org/jira/browse/XERCESJ-1559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mukul Gandhi updated XERCESJ-1559:
----------------------------------
Fix Version/s: 2.12.0
> the root instance element doesn't validate via xsi:type reference if the type is a simpleType having an assertion, and an element declaration is absent
> -------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: XERCESJ-1559
> URL: https://issues.apache.org/jira/browse/XERCESJ-1559
> Project: Xerces2-J
> Issue Type: Bug
> Components: XML Schema 1.1 Datatypes
> Affects Versions: 2.11.0
> Reporter: Jorge L. Williams
> Assignee: Mukul Gandhi
> Fix For: 2.12.0
>
>
> In the latest XSD 1.1 branch, it looks like simple type assertions are not being enforced when the type is specified via the xsi:type attribute. I'm attaching a schema and instance documents as a reference.
> If I do
> java -cp $CLASSPATH jaxp.SourceValidator -fx -xsd11 -a assertion.xsd -i even_bad.xml
> I get a correct error, but if I do
> java -cp $CLASSPATH jaxp.SourceValidator -fx -xsd11 -a assertion.xsd -i number_bad.xml
> I don't get an error at all.
> assertion.xsd:
> ---------------------
> <schema
> elementFormDefault="qualified"
> attributeFormDefault="unqualified"
> xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:tst="http://www.rackspace.com/test/assertion"
> targetNamespace="http://www.rackspace.com/test/assertion">
> <element name="even" type="tst:Even"/>
> <!-- Simple Types -->
> <simpleType name="Even">
> <restriction base="xsd:int">
> <minInclusive value="0"/>
> <maxInclusive value="100"/>
> <assertion test="$value mod 2 = 0"/>
> </restriction>
> </simpleType>
> </schema>
> -------------
> even_bad.xml
> -----------
> <even xmlns="http://www.rackspace.com/test/assertion">13</even>
> -----------
> number_bad.xml
> ------------
> <number xmlns:tst="http://www.rackspace.com/test/assertion"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:type="tst:Even"
> >13</number>
> ------------
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org