I have the following XSD schema:
<xsd:schema xmlns="http://www.mynamespace.test/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.mynamespace.test/" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:include schemaLocation="../Components.xsd"/>
<xsd:element name="PO" type="POType"/>
<xsd:complexType name="POType">
<xsd:sequence>
<xsd:element ref="PA" maxOccurs="unbounded"/>
<xsd:element ref="PB" maxOccurs="unbounded"/>
<xsd:any minOccurs="0" />
</xsd:sequence>
<xsd:attributeGroup ref="SomeAttrGroup"/>
<xsd:attributeGroup ref="SomeOtherAttrGroup"/>
</xsd:complexType>
</xsd:schema>
Where I basically want to make sure that my PO element contains PA elements and PB elements (PA before PB), where there are any kind of elements allowed to be in front of PA, in between PA and PB and after PB... I tried adding xsd:any at all those places, but even only one of them is not possible because of "Unique Particle Attribution".
I understand why this raises an error (can't tell the difference between an existing PB element to belong to the ANY part or the actual PB in the sequence). But I see no way of how to achieve what I actually want: is it possible at all, and how would it be done?
PS: The ANY elements can be in the same namespace as the PA and PB elements, just not the PA/PB elements itself.