[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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>
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 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.