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

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

From: janne postilista <jannepostilistat@gmail.com>
Date: Tue, 31 Aug 2010 17:33:54 +0300
Message-ID: <AANLkTimh4_jSPvs2NqO5tKJRDdguaQ0UbsZXaF6_iWnO@mail.gmail.com>
To: xmlschema-dev@w3.org

 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?

My schema:

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified" >

    <xsd:import namespace="some-B"
    schemaLocation="fault.xsd" />

    <xsd:element name="MyResponse">
                    <xsd:any namespace="##targetNamespace"/>
                    <xsd:element name="Fault" type="fault:FaultType" />

When validating I get

XML validation started.
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 07:57:36 UTC

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