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

Re: reference to element, elementFormDefault unqualified

From: Jeff Rafter <lists@jeffrafter.com>
Date: Thu, 13 Apr 2006 09:48:46 -0700
Message-ID: <443E80EE.50309@jeffrafter.com>
To: Oliver Kusche <oli@trip.net>
CC: xmlschema-dev@w3.org
elementformdefault unqualified meaning



Oliver Kusche wrote:
> 
> Thanks for pointing this out. I'm merely setting
> elementFormDefault="unqualified" to hide namespaces from my instance 
> documents
> so that it's not visible which component an element belongs to (making 
> instance
> documents a lot more readable).
> 
> So do you suggest that's not really a good practice?

Well, its not really possible. Global elements are always qualified by 
the targetNamespace regardless of the form or elementFormDefault 
attributes. Now, if the targetNamespace is empty than there will be no 
qualification in the instance document.

<Odd techincal point>
Michael mentioned using Chameleon namespace design to get around this... 
but that won't help. As soon as a no-namespace global schema component 
is included into a schema that declares a targetNamespace it takes on 
that namespace (meaning it will need to be qualified in the instance).
</Odd technical point>

So in reality, if you don't want to have namespaces in your instance 
documents you have two choices: (1) don't use targetNamespaces in any of 
your XML Schemas for the document (2) don't use XML Schemas

I also agree with Michael-- I have never fully understood the decision 
that gives us this strange situation.

All the best,
Jeff Rafter
Received on Thursday, 13 April 2006 16:46:38 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.