Christian,

Yes, the attachment made it to the list though haven't had an opportunity
to look at it yet.

Thanks.

Michael Glavassevich
XML Technologies and WAS Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Christian Greene <christian.gre...@oracle.com> wrote on 01/11/2012 03:39:23
PM:

> Michael, did you get this previous email or did it bounce because of
> the zip attachement?
>
> Thanks
> -Christian
>
> From: Christian Greene
> Sent: Monday, January 09, 2012 3:48 PM
> To: mrgla...@ca.ibm.com
> Cc: j-users@xerces.apache.org
> Subject: RE: Validation of Types has changed from 2.9.1
>
> Hi Michael,
>
> As requested, I have produced a unit test that produces the behavior
> (attached zip). Place Java class and XSD into a path like src/test/
> xml/ and run the Java class as a junit test and it will fail like ?
> cvc-complex-type.2.4.a: Invalid content was found starting with
> element 'b:InnerTypeExtra1'??
>
> With 2.11.0 it fails. With 2.9.1, it passes.
>
> Cheers,
> -Christian
>
> Hi Christian,
>
> Do you have a complete test case (in addition to the XSDs you provided,=
>
> Java code + XML document) that you can share?
>
> Thanks.
>
> Michael Glavassevich
> XML Technologies and WAS Development
> IBM Toronto Lab
> E-mail: mrgla...@ca.ibm.com
> E-mail: mrgla...@apache.org
>
>
> From: Christian Greene
> Sent: Wednesday, January 04, 2012 2:36 PM
> To: j-users@xerces.apache.org
> Subject: Validation of Types has changed from 2.9.1
>
> Hi,
>
> This is not an issue when I use Xerces-J 2.9.1, but because of a
> known security issue our group is supposed to be using 2.11.0. When
> I execute validation unit tests with the 2.11.0 Xerces library,
> tests that passed validation before do not now. In advance, I will
> admit the schemas being used are complex, but it was working and I
> am wondering if anyone knows what changed and if the behavior is
> configurable or pluggable in any way.
>
> The following snippets layout the issue:
>
> SchemaA
>                 xmlns:b="http://www.acme.com/schemas";
> <xs:import namespace="http://www.acme.com/schemas"; schemaLocation=
> "SchemaB.xsd"/>
>
> <xs:complexType name="MainType">
> <xs:complexContent>
> <xs:extension base="MainType">
> <xs:group ref="b:MainTypeExtraElements"/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
>
> <xs:complexType name="InnerType">
> <xs:complexContent>
> <xs:extension base="InnerType">
> <xs:group ref="b:InnerTypeExtraElements"/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
>
> SchemaB
> <xs:import namespace="http://www.3rdparty.com/namespace"; schemaLocation=
> "SchemaC.xsd"/>
> <xs:import namespace="http://www.3rdparty.com/namespace"; schemaLocation=
> "SchemaD.xsd"/>
>
> <xs:group name="MainTypeExtraElements">
> <xs:sequence>
> <xs:element name="MainTypeExtra1" type="xs:string" minOccurs="0"/>
> <xs:element name="MainTypeExtra2" type="xs:string" minOccurs="0"/>
> </xs:sequence>
> </xs:group>
>
> <xs:group name="InnerTypeExtraElements">
> <xs:sequence>
> <xs:element name="InnerTypeExtra1" type="xs:string" minOccurs="0"/>
> </xs:sequence>
> </xs:group>
>
> SchemaC
> <xs:complexType name="MainType">
> <xs:sequence>
> <xs:element name="MainElement1" type="xs:string"/>
> <xs:element name="MainElement2" type="xs:boolean" minOccurs="0"/>
> <xs:element name="InnerTypeElement" type="InnerType" minOccurs="0"/>
> </xs:sequence>
> </xs:complexType>
>
> SchemaD
> <xs:complexType name="InnerType">
> <xs:sequence>
> <xs:element name="InnerElement1" type="xs:string"/>
> <xs:element name="InnerElement2" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
>
> In 2.9.1, when XML was validated that had extra elements in the
> inner type ?InnerType? it would validate fine. With 2.11.0, the
> validation fails once InnerTypeExtra1 is traversed complaining that only
> InnerElement1 or InnerElement2 is expected. So before when SchemaC
> would reference InnerType, the definition from SchemaA was used, but
> now it seems that the definition from SchemaD is used. MainTypeExtra1
> would likely fail as well if the validation ever got that far.
>
> Does that follow? Anyone have a solution?
>
> Thanks,
> -Christian

Reply via email to