Page 1 of 1

XML Schema 1.1 wildcard question

Posted: Sat Sep 26, 2009 8:22 pm
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

Re: XML Schema 1.1 wildcard question

Posted: Sat Sep 26, 2009 8:58 pm
by madde001
( :oops:) forgot <choice> after <except> in RNG

Re: XML Schema 1.1 wildcard question

Posted: Mon Sep 28, 2009 10:34 am
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

Re: XML Schema 1.1 wildcard question

Posted: Mon Sep 28, 2009 3:50 pm
by madde001
George.

Thanks!

John