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

Re: More on namespaces...


Re:  More on namespaces...
Seairth Jacobs wrote:
> The whole xmlns thread has left me more confused about what should and
> should not be done with namespaces...  so, can someone answer these
> questions:
> 
> 
> 1) Suppose you have a vocabulary that states that only <B> may be within
> <A>.  Now suppose you have another vocabulary with element <C>.  If one were
> to do <ns1:A><ns1:B/><ns2:C/></ns1:A>, would the document still be valid
> according to the first vocabulary?

If I understand you, no. <A> and <ns1:A> are different things. You 
probably could write RNG that would validate both but it would be a 
kluge.

> 
> 2) Given the various levels of support for xml namespaces in tools, what
> would be the pros/cons of the following practice:
> 
> The document's primary vocabulary is never namespaced.  

No reason for this that I can think of. Once you're using 
namespaces, you don't gain much by only using them sometimes.


> Secondary
> vocabularies are always namespaced.  

See permathreads elsewhere.


> Default namespacing is never used.  

Yes. Default namespaces don't play nice with non-namespaced XML. 
This allows you to add non-namespaced elements with the comfort of 
knowing you haven't accidently adding them into a namespace. A 
default ns is for situations where you know you don't want to mix 
and match.

But it is an extra constraint, and you'd need to coordinate all 
processors to obey it. It only takes once process to start acting 
the maggot with a default namespaces to poison the the well.


> the primary vocabulary will also act in a secondary fashion (e.g.
> "mustUnderstand" in SOAP), then it will be namespaced.  

Lost me. Are you talking about recursive structures?

But the key thing. Once you use namespaces you should use them as 
given, and be prepared to absorb the overhead involved. Adding 
processing rules and constraints over and above the Namespaces spec 
hasn't been a winning approach in my experience - the singe 
exception being the elimination of the default namespace.

Bill de hÓra


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.