Re: namespace node implementation

Michael Brundage wrote:

> Why not just emulate the behavior of existing XSLT implementations?  As a
> user, that's the behavior I would expect.

But as an implementor it's more complicated for me ...

To repeat:  I'm hoping for feedback on the proposed *implementation*.
Part of that is I'm hoping more experienced users *and* implementors can 
advice me whether my proposed implementation would produce results close 
to users' expectations.  Of course that is hard to judge without an 
actual implementation, but I posted the algorithm in case somebody says 
"that's dumb because ..." or "it will produce output that is incorrect 
or different from user expectations."  Noone has done that so far, but 
no-one has commented very favorably either.

The "behavior of existing XSLT implementations" is of course 
implementation-defined.  I don't have much experience with 
implementations.  (I've mostly used them with documents that don't use 
namespaces.)  Do most of them behave more-or-less the same wrt to 
namespace serialization?

Also note that existing XSLT implementations must implement the 
XSLT/XPath 1.0 semantics of namespaced nodes.  This is very expensive. 
On the other hand, once you have all the namespaces of an element 
directly accessible as namespace nodes, basic serialization is trivial: 
  For each element emit all of its namespace modes as namespace 
attributes, unless it is redundant because it has been emitted by an 
ancestor.  (Yes, I realize it's not quite that simple!)

My hope is that my algorithm will come produce output similar to (or no 
worse) than existing implementations but do so much more cheaply.
	--Per Bothner

Received on Tuesday, 21 October 2003 23:48:36 UTC