Re: Unique Particle Attribution with xsd:any and xsd:element with different namespaces

  On 31/08/2010 3:33 PM, janne postilista wrote:
> Hi,
>
>   I am trying to create a choice with either a xsd:any from namespace A
> or xsd:element from namespace B. I think that because they are from
> different namespaces there should be no ambiguity, am I wrong?

But they aren't in different namespaces. Both the element particle and 
the wildcard particle are in namespace some-A.

Michael Kay
Saxonica
> My schema:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>      targetNamespace="some-A"
>      xmlns:tns="some-A"
>      xmlns:fault="some-B"
>      elementFormDefault="qualified">
>
>      <xsd:import namespace="some-B"
>      schemaLocation="fault.xsd" />
>
>      <xsd:element name="MyResponse">
>          <xsd:complexType>
>                  <xsd:choice>
>                      <xsd:any namespace="##targetNamespace"/>
>                      <xsd:element name="Fault" type="fault:FaultType" />
>                  </xsd:choice>
>          </xsd:complexType>
>      </xsd:element>
>
> When validating I get
>
>
> XML validation started.
> D:/zzz.xsd:33,8
> ERROR: cos-nonambig: WC["some-A"] and "hsome-A":Fault (or elements
> from their substitution group) violate "Unique Particle Attribution".
> During validation against this schema, ambiguity would be created for
> those two particles.
>
> 1 Error(s),  0 Warning(s).
> XML validation finished.
>
> What is the problem?
>
>
>

Received on Wednesday, 1 September 2010 08:09:23 UTC