W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2010

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

From: Michael Kay <mike@saxonica.com>
Date: Wed, 01 Sep 2010 09:08:51 +0100
Message-ID: <4C7E0A13.5010803@saxonica.com>
To: janne postilista <jannepostilistat@gmail.com>
CC: xmlschema-dev@w3.org
  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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:18 UTC