XML Schema 1.1 wildcard question

This should cover W3C XML Schema, Relax NG and DTD related problems.
madde001
Posts: 80
Joined: Fri Apr 23, 2004 5:24 pm
Location: Durham, NC, USA

XML Schema 1.1 wildcard question

Post by madde001 »

In Relax NG it's real easy to exclude elements in a list of namespaces that includes the no-namespace namespace:

<anyName>
<except>
<nsName ns="http://example.com/>
<nsName ns=""/>
</except>
</anyName>

This simple thing is (afaik) impossible in XML Schema 1.0, and for XML Schema 1.1 the spec is (so typical!) impossible to figure out how to do this simple thing. (Which is why I use RNG!)

Anyway, can anyone tell me how to do this is XMLS 1.1? Does this work:

<any notNamespace="http://example.com ''"/>

(in other words, a pair of single quotes in the list) Some other way?

John
madde001
Posts: 80
Joined: Fri Apr 23, 2004 5:24 pm
Location: Durham, NC, USA

Re: XML Schema 1.1 wildcard question

Post by madde001 »

( :oops:) forgot <choice> after <except> in RNG
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: XML Schema 1.1 wildcard question

Post by george »

Hi John,

You can use
  • ##targetNamespace - for the schema target namespace
  • ##local - for no namespace
In your case what you want is:

Code: Select all

<any notNamespace="http://example.com ##local"/>
Best Regards,
George
George Cristian Bina
madde001
Posts: 80
Joined: Fri Apr 23, 2004 5:24 pm
Location: Durham, NC, USA

Re: XML Schema 1.1 wildcard question

Post by madde001 »

George.

Thanks!

John
Post Reply