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
             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]

Reply via email to