Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.9.1
-
None
Description
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