[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: xml-dev@l...
  • Date: Wed, 19 Sep 2001 14:04:25 -0400

Re:  RE: Namespaces Best Practice
At 10:43 AM 9/19/2001 -0700, Joe English wrote:
>I think that any sensible Infoset implementation wouldn't
>actually allocate storage for each namespace node.
>Instead, it would synthesize a list of namespace nodes from
>the in-scope namespace declaration nodes on demand.

I'm working on this right now in a generic XML-handling framework, and it's 
not an easy problem to solve.  Preserving namespace nodes from the original 
document is handy because:

a) it preserves the original document structure, when that's valued
b) it tends to reduce the number of times a namespace is declared over the 
course of a document.  (unless, of course, the creator of the document was 
deliberately perverse.)

Synthesizing lists is useful because:
a) it reduces the amount of storage needed overall
b) it makes it much simpler to chop pieces out of documents and reuse them 
elsewhere.

The problem I'm finding is that synthesizing lists efficiently is 
hard.  I've tolerated the results in things like David Megginson's (very 
useful) XML Writer classes, but I tend to wind up with many more namespace 
declarations than I wanted.

I'm still looking for efficient approaches to managing namespace context 
and declaration generation, and haven't yet found something I'm happy 
with.  (I've only been addressing the problem directly for about a month, 
so maybe I just haven't figured it out yet.)

The xmlns or xmlns:prefix approach has also made things more complicated 
than I thought they'd be, but I'm past most of that.

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.