[xsde-users] Re: [xsd-users] XSDE support for element 'any'

Boris Kolpackov boris at codesynthesis.com
Fri Sep 19 11:59:38 EDT 2008


Hi Neeraj,

In the future please send questions about XSD/e to the xsde-users
mailing list instead of xsd-users. I have switched to this mailing
list in my reply.

Neeraj Seshadri <sneeraj2 at yahoo.com> writes:

> Does the XSDE code generation support the element of
> form any as shown below
> 
> <xs:any namespace="##any" processContents="lax">
> </xs:any>

Yes, it does. Please see the 'wildcard' examples in the
examples/cxx/tree/ and examples/cxx/parser/ directories.


> When I tried to use this in my schema I am getting the
> following error.
> 
> :0:0: error: Complex type '__AnonC1' violates the
> Unique Particle Attribution rule in its components
> 'targetName' and '##any'

This error message indicates that your schema violates the
Unique Particle Attribution (UPA) rule. The specification
states that the XML Schema validator should be able to
uniquely attribute an element being validated to an XML
Schema declaration. Consider this example:

<complexType name="foo">
  <sequence>
    <element name="bar" type="string" minOccurs="0"/>
    <any namespace="##any" processContents="lax"/>
  </sequence>
</complexType>

This fragment violates the UPA rule because when a validator
sees the 'bar' element in an XML document, it can validate
it in two ways: it can attribute 'bar' to the element
declaration or it can assume the element declaration is
not present (minOccurs="0") and attribute 'bar' to the
any wildcard.

For more information refer to Section 3.8.6, "Constraints on
Model Group Schema Components" in the XML Schema specification:

http://www.w3.org/TR/xmlschema-1/#coss-modelGroup

Boris



More information about the xsde-users mailing list