[xsd-users] ##any type problems

Bradley Beddoes beddoes at intient.com
Sun Dec 17 18:20:37 EST 2006


Hello Boris,

Boris Kolpackov wrote:
> 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.

Yes thats exactly how it is intended to be used here in the SAML schema, 
ArtifactResponse the element having problems may contain any message 
from the SAML protocol when it is being transmitted

> 
> 
>> 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.

Understood.

> 
> 
>> 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.

It is definitely the desire of the authors of the schema (OASIS 
standards body) to use ##any here, and its something I can't change 
personally but do need to support it.

What sort of work would be required to support this?

> 
> 
> hth,
> -boris



More information about the xsd-users mailing list