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

Re: RE: Namespaces Best Practice

  • From: "Simon St.Laurent" <simonstl@s...>
  • To: David Brownell <david-b@p...>, Rick Jelliffe <ricko@a...>,xml-dev@l...
  • Date: Thu, 20 Sep 2001 14:29:02 -0400

Re:  RE: Namespaces Best Practice
At 10:57 AM 9/20/2001 -0700, David Brownell wrote:
>But aren't there issues like "how far do you bubble down"?
>Normally I'll think that certain nodes in a given document will
>be natural spots to bubble down to, even if some decls could
>get bubbled down even further.

This is where the problems start to get interesting.  From the point of 
view of least-number-of-declarations, you need to check a big chunk of the 
tree to put namespace declarations in the element which is one above where 
the namespace actually gets used.

Putting namespace declarations in where they are used (tight scoping) works 
well when a namespace only appears once, but produces piles of declarations 
that could have been avoided when a namespace appears lots of time over the 
course of a document but is scattered.  (XLink tends to do that, but there 
are lots of other cases.)

It's the kind of problem humans are generally good at solving but which 
take some algorithmic tree-trickery to solve efficiently on a computer.

As a guideline, I'm pretty happy with "declare all namespaces on the root 
element whenever possible", while still recognizing that isn't always possible.

Finally, I don't think variable-scoping is a useful comparison for 
namespace-scoping in XML documents.  There aren't a lot of 
XLink-attribute-like things that get used in a scattered way across a Java 
program but are still in the same namespace, for instance.  Variable 
scoping is nicely contained by the logic of program flow, while namespace 
scoping may be much more arbitrary.

Simon St.Laurent
Associate Editor
O'Reilly & Associates, Inc.

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.