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

Re: XML Schemas: Best Practices

  • From: "Roger L. Costello" <costello@m...>
  • To: xml-dev@l...
  • Date: Mon, 19 Mar 2001 13:50:25 -0500

elementformdefault best practice
Hi Folks,

I would like to revisit our Best Practice on "Hide (Localize) Versus
Expose Namespaces"[1].

Recall that, with respect to namespace exposure, there are two ways to
design your schema:

1. Set elementFormDefault="unqualified" to hide (localize) the namespace
complexities within the schema.

2. Set elementFormDefault="qualified" to expose in instance documents
the namespaces of all the components being used by the schema.

This all works fine when you are just using schemas that you have
created.  That is, to hide (localize) namespace complexities just make
sure that all your schemas have set elementFormDefault="unqualified". 
Similarly, to expose namespaces just make sure that all your schemas
have set elementFormDefault="qualified".  

What about when you are using schemas that somebody else created - what
if their schema has set elementFormDefault="qualified", but you desire a
design where the namespaces of all components being used are hidden. 
What do you do?  It would appear that you cannot achieve your design
goal of localizing the namespace complexities within the schemas.

So, here is what I propose as Best Practice: whenever you create a
schema (or group of schemas) create TWO versions:

1. One version where all the schemas have set
elementFormDefault="unqualified".

2. A second version, which is IDENTICAL to the first version, except
elementFormDefault="qualified".

This way, when someone else reuses your schemas they will be able to
implement either design - hide or expose.  

I realize that making an identical version of all your schemas with the
only difference being the value of elementFormDefault is rather awkward,
but I see no way around this.  I hope that someone can show me a better
way.  /Roger

[1] http://www.xfront.com/HideVersusExpose.html


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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-2013 All Rights Reserved.