RE: XSD 1.1 Proposal: Naming wildcard extension sites

> Basically what 
> I need is the ability to say I want any namespace with a 
> particular structure to it, and I suppose it would be best 
> served by using the regular expressions ability of XSD.
> 
> We would find it a boon and a blessing to say that any 
> namespace is allowed inside of an extension element as long 
> as it starts with rep.oio.dk. 

In XML Schema 1.1* (and in the next Saxon release) you will be able to say

<xs:assert test="starts-with(namespace-uri(*[last()]), 'rep.oio.dk'))"/>

* (actually the current W3C draft defines a rather restrictive XPath subset
for assertions. But it allows processors to implement the whole of XPath
2.0, and that's what Saxon will do.)

I think xs:assert is going to prove an immensely popular feature, assuming
that vendors don't cripple it to the extent suggested in the current draft.
For this particular use case it's a bit awkward that you can only put
xs:assert on a complex type - not on the element wildcard itself - but it's
not too hard to work around that.

Michael Kay
http://www.saxonica.com/

Received on Monday, 12 March 2007 11:42:14 UTC