You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Alberto Massari (Closed) (JIRA)" <xe...@xml.apache.org> on 2012/01/16 15:12:39 UTC
[jira] [Closed] (XERCESC-1975) InvalidDatatypeValueException thrown
when parsing a UnionDataType
[ https://issues.apache.org/jira/browse/XERCESC-1975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alberto Massari closed XERCESC-1975.
------------------------------------
Resolution: Cannot Reproduce
I tested the testcase against the current codebase, and they pass the validation phase. The problem described resembles a fix done in 2008, and that was already part of the 3.1 codebase. Are you sure you are using version 3.1.1?
> 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
> Attachments: TestDoc.xml, TestSchema.xsd
>
>
> 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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org