XML Schema 1.1 wildcard question

This should cover W3C XML Schema, Relax NG and DTD related problems.
madde001
Posts: 80
Location: Durham, NC, USA

XML Schema 1.1 wildcard question

Sat Sep 26, 2009 8:22 pm

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
Location: Durham, NC, USA

Re: XML Schema 1.1 wildcard question

Sat Sep 26, 2009 8:58 pm

( :oops:) forgot <choice> after <except> in RNG
george
Site Admin
Posts: 2100

Re: XML Schema 1.1 wildcard question

Mon Sep 28, 2009 10:34 am

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
Location: Durham, NC, USA

Re: XML Schema 1.1 wildcard question

Mon Sep 28, 2009 3:50 pm

George.

Thanks!

John

Return to “XML Schemas”

Who is online

Users browsing this forum: No registered users and 1 guest