OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xml-dev] RE: Namespaces Best Practice




Simon St.Laurent wrote:
> 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.  [...]
> 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.)


Don't know if this will be helpful or not, but you should take a
look at Henry Baker's papers [1] "Shallow Binding in Lisp 1.5" [2]
and "Shallow Binding Makes Functional Arrays Fast" [3].
He describes a data structure -- a "rerootable environment tree",
originally designed to implement dynamic scoping in Lisp --
that looks like it would be very handy for implementing XML
namespace scoping rules.

You could store a pointer to the namespace environment at
each node; then when cloning or moving a node you wouldn't
need to copy any namespace declaration nodes at all, just
the environment pointer.  When serializing, you could track
the rerooting process to determine when to emit namespace
declarations.  Extracting the list of in-scope namespace nodes
at any point in the tree is also straightforward.


--Joe English

  jenglish@flightlab.com


[1] Finally back online at <URL: http://home.pipeline.com/~hbaker1/ >
    Yay!
[2] <URL: http://home.pipeline.com/~hbaker1/ShallowBinding.html >
[3] <URL: http://home.pipeline.com/~hbaker1/ShallowArrays.html >