|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XML Schemas: Best Practices
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








