InvalidDatatypeValueException thrown when parsing a UnionDataType
-----------------------------------------------------------------

                 Key: XERCESC-1975
                 URL: https://issues.apache.org/jira/browse/XERCESC-1975
             Project: Xerces-C++
          Issue Type: Bug
          Components: Validating Parser (XML Schema)
    Affects Versions: 3.1.1
            Reporter: Ashish Singhal
            Priority: Blocker


InvalidDatatypeValueException is thrown when parsing an XML document that 
contains a Union data type and the union is contains another simple data type, 
eg:

Given this schema:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
elementFormDefault="qualified" attributeFormDefault="unqualified">
        <xs:element name="TestDoc">
                <xs:complexType>
                        <xs:sequence>
                                <xs:element name="SomeElement"/>
                        </xs:sequence>
                        <xs:attribute name="testAttribute" type="SubString"/>
                </xs:complexType>
        </xs:element>
        <xs:simpleType name="SubPattern">
                <xs:restriction base="xs:string">
                        <xs:pattern value=".*\{.*\}.*"/>
                </xs:restriction>
        </xs:simpleType>
        <xs:simpleType name="SubString">
                <xs:union memberTypes="SubPattern xs:string"/>
        </xs:simpleType>
</xs:schema>


This XML should be valid:

<?xml version="1.0" encoding="UTF-8"?>
<TestDoc xsi:noNamespaceSchemaLocation="TestSchema.xsd" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
testAttribute="true"
>
<SomeElement/>
</TestDoc>

However an InvalidDatatypeValueException is thrown when validating this 
document.

Changing my schema to remove SubPattern from the SubString union, fixes the 
issue, but it's not the solution I'm looking for. 

I would like xerces-c to validate the document correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to