RE: Recursive XSD with targetNamespace

Michael Kay writes:

> Very little that's in XSD makes intuitive sense - get used to it.

I agree that there's all to much that doesn't but I'm not sure I agree on 
this one.
 
> The basic rule is that when you are defining a component (such as an
> element declaration), the "name" attribute gives the local name, and
> it is implicitly qualified by the targetNamespace.

What's so unusual about this.  It's very much like, say, declaring a 
package at the beginning of a java source file.  If you declare a 
package/targetNamespace, then things you define in the source file tend to 
implicitly be in the package/targetNamespace. 

> When you are 
> referencing a component, you use a QName in the "ref" attribute, and
> if the QName is unprefixed, it refers to a name in the default 
> namespace - not the target namespace

If you reference something that's from a package/targetNamespace that's 
not implicitly in scope (e.g. from a Java "import" or a default xmlns:), 
then you have to make an explicilty qualified reference. Yes, these things 
can be confusing if you think about them wrong, but I'm not convinced that 
their the best examples of unnecessary obscurity in XSD.

Noah 

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------

Received on Tuesday, 18 November 2008 16:24:52 UTC