W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2008

RE: Recursive XSD with targetNamespace

From: <noah_mendelsohn@us.ibm.com>
Date: Tue, 18 Nov 2008 11:23:52 -0500
To: "Michael Kay" <mike@saxonica.com>
Cc: "'Todd Moon'" <tmrfcm@gmail.com>, xmlschema-dev@w3.org
Message-ID: <OFE6C6E471.96F47A6F-ON85257505.0059C67C-85257505.005A1056@lotus.com>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:09 GMT