![]() |
|
|
|
|
Issue Type:
|
Bug
|
|
Affects Versions:
|
3.1.1 |
|
Assignee:
|
Unassigned |
|
Components:
|
SAX/SAX2 |
|
Created:
|
15/May/12 09:06
|
|
Description:
|
if i parse the following xml:
<?xml version="1.0" encoding="UTF-8"?>
<State>
<testsub>123456</testsub>
<testsub2>123456</testsub2>
</State>
with the XSD:
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="State" type="StateType" />
<xsd:complexType name="StateType">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1" name="testsub" type="xsd:nonNegativeInteger"/>
<xsd:element minOccurs="0" maxOccurs="0" name="testsub2" type="xsd:nonNegativeInteger"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
An error is generated:
Message: element 'testsub2' is not allowed for content model
whereas the XSD:
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="State" type="StateType" />
<xsd:complexType name="StateType">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="0" name="testsub" type="xsd:nonNegativeInteger"/>
<xsd:element minOccurs="0" maxOccurs="1" name="testsub2" type="xsd:nonNegativeInteger"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
does not generate an error
NB: xerces 2.7 doe never generates an error
this is easilly reproduced with the sample code in xerces-c-3.1.1/samples/src/PParse
|
|
Project:
|
Xerces-C++
|
|
Priority:
|
Major
|
|
Reporter:
|
Reinier vos
|
|
|
|
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
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]