UPA and extensions
If I create an XML schema (XSD) that includes a complexType that extends another complexType resulting in a violation of unique particle attribution (UPA) it still validates using libxml / xmllint but shows as invalid with other libraries such as Xerces.
I realize this use case may seem somewhat contrived, but it is based on a real-world standards applications attempting to follow these extensibility recommendations (All new components in existing or new namespace(s) for each compatible version (# 3)) to allow for future versions of the standardized XSD.
Here is a simplified XSD and an example XML demonstrating the issue:
XSD:
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://example.com" targetNamespace="http://example.com" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.2">
<xs:complexType name="Child">
<xs:complexContent>
<xs:extension base="Parent">
<xs:sequence>
<xs:element name="Foo" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="r2_3" type="Revision2_3Type" minOccurs="0" maxOccurs="1"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute processContents="lax"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Parent">
<xs:sequence>
<xs:element name="r2_3" type="Revision2_3Type" minOccurs="0" maxOccurs="1"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute processContents="lax"/>
</xs:complexType>
<xs:complexType name="Revision2_3Type">
<xs:sequence>
<xs:any processContents="lax" minOccurs="1" maxOccurs="unbounded" namespace="##targetNamespace"/>
</xs:sequence>
<xs:anyAttribute processContents="lax"/>
</xs:complexType>
<xs:element name="Child" type="Child" />
</xs:schema>
XML:
<Child xmlns="http://example.com">
<r2_3>
<test>bar</test>
</r2_3>
</Child>
Edited by Robby Simpson