[xsd-users] ##any type problems

Boris Kolpackov boris at codesynthesis.com
Thu Dec 14 10:02:19 EST 2006


Hi Bradley,

Bradley Beddoes <beddoes at intient.com> writes:

> saml-schema-protocol-2.0.xsd:229:81: error: namespace '##any' allows for
> element 'Status'
> saml-schema-protocol-2.0.xsd:52:42: error: element 'Status' is defined here
> saml-schema-protocol-2.0.xsd:229:81: error: such wildcards are not supported
>
> The schema is available from:
> http://docs.oasis-open.org/security/saml/v2.0/saml-schema-protocol-2.0.xsd
>
> The corresponding piece of schema is:
>
>    <element name="ArtifactResponse" type="samlp:ArtifactResponseType"/>
>    <complexType name="ArtifactResponseType">
>    	<complexContent>
>            <extension base="samlp:StatusResponseType">
>                <sequence>
>                    <any namespace="##any" processContents="lax"
>                    minOccurs="0"/>
>                </sequence>
>            </extension>
>    	</complexContent>
>    </complexType>

The special ##any namespace name indicates that an element from any
namespace, including the target namespace of the schema, can appear.
As a result, in order to support this widlcard in general case, one
needs to perform full-blown structure validation in order to determine
which elements are matched by which schema declaration. In the example
above, an element with name 'Status' can appear for the wildcard
which will make the current parsing code fail to associate this
element properly. That's why XSD detects such cases and refuses
to generate the code.


> There is another instance of ##any in the same schema file which seems
> to pass by without problem,

That usage is fine since there are no other elements in that type.


> Can anyone please advise if XSD should be able to compile this schema
> and if so what I might be doing wrong? The "such wildcards are not
> supported" statement is a bit of a concern.

It is rarely an intention of a schema author to allow elements from
the same schema to appear in the wildcard. So the first thing I suggest
you do is check the semantic of the type and whether you can replace
##any with ##other. I will also take some time to think if there is
a way to support this without implementing full-blown structure
validation.


hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061214/966fcf7c/attachment.pgp


More information about the xsd-users mailing list