[
https://issues.apache.org/jira/browse/XERCESJ-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851553#action_12851553
]
Kun Xu commented on XERCESJ-1434:
---------------------------------
Hi Michael,
I have created a patch for this defect, however it also a patch for another
feature "doesn't support NaN".
Example:
XSD:
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.schemaTest.org/schema11"
xmlns:sv="http://www.schemaTest.org/schema11">
<simpleType name="pSpecial">
<restriction base="precisionDecimal">
<enumeration value="INF"/>
<enumeration value="NaN"/>
</restriction>
</simpleType>
<element name="root">
<complexType>
<sequence>
<element name="Special1" type="sv:pSpecial"
minOccurs="1" maxOccurs="unbounded"/>
</sequence>
</complexType>
</element>
</schema>
XML:
<?xml version="1.0" encoding="UTF-8"?>
<dv:root xmlns:dv="http://www.schemaTest.org/schema11"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.schemaTest.org/schema11
test_NAN.xsd">
<Special1>NaN</Special1>
<Special1>INF</Special1>
</dv:root>
The XML file will be failed because of the "NaN"
Should I open another issue for "NaN"?
I attach the patch for both "assertion" and "NaN".
Thanks.
> assertion in simplexContent in complexType with restriction
> -----------------------------------------------------------
>
> Key: XERCESJ-1434
> URL: https://issues.apache.org/jira/browse/XERCESJ-1434
> Project: Xerces2-J
> Issue Type: Bug
> Components: XML Schema 1.1 Structures
> Affects Versions: 2.9.1
> Reporter: Kun Xu
> Assignee: Mukul Gandhi
> Fix For: 2.10.0
>
>
> Fail to apply base type's assertion.
> Example:
> <?xml version="1.1"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="root" type="rootType" />
> <xs:complexType name="rootType">
> <xs:simpleContent>
> <xs:restriction base="xs:anyType">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:assertion
> test="invalid-XPath-expression()"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:restriction>
> </xs:simpleContent>
> </xs:complexType>
> </xs:schema>
> <xs:assertion test="invalid-XPath-expression()"/> won't be tested.
> Reason:
> Missing "inherit assertion" code in
> * @version $Id: XSSimpleTypeDecl.java 904730 2010-01-30 06:40:11Z mukulg $
> Patch:
> add
> // inherit assertion. added for XML Schema 1.1
> if ((fFacetsDefined & FACET_ASSERT) == 0 && (fBase.fFacetsDefined &
> FACET_ASSERT) != 0) {
> fFacetsDefined |= FACET_ASSERT;
>
> if ((fixedFacet & FACET_ASSERT) != 0)
> {
> fFixedFacet |= FACET_ASSERT;
> }
> }
>
> to the end of step 4 in function
> void applyFacets(XSFacets facets, int presentFacet, int fixedFacet, short
> patternType, ValidationContext context)
> throws InvalidDatatypeFacetException
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]