Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Human-readable specification of the Nux XPath/XQuery result serialization algorithm?

xom-interest AT

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Michael Kay" <mike AT>
  • To: "'William Vambenepe'" <william.vambenepe AT>, <xom-interest AT>
  • Subject: Re: [XOM-interest] Human-readable specification of the Nux XPath/XQuery result serialization algorithm?
  • Date: Wed, 22 Oct 2008 21:17:25 +0100

> The W3C algorithm has several shortcomings, as documented in
> the ResultSequenceSerializer Javadoc
> (
> lizer.html).
> Overall, the situation is not bright for flexible and
> interoperable XML serialization of XPath/XQuery results
> (
> The "wrap algorithm" from Nux, on the other hand, appears
> very simple and useful. Why the W3C didn't take a similar
> approach is something I'd like to understand if anyone has
> any insight.

(a) most people on the relevant WGs were far more interested in XSLT and
XQuery transformations/queries that generate a new document which is to be
serialized directly, rather than in free-standing XPath

(b) the idea of defining a wrapped serialization was certainly mentioned but
the people who were interested in it (like me) didn't have the time or
energy to push it through, given how much other more important work there
was on the agenda

(c) it's not actually trivial to define a wrapped serialization; there are
multiple objectives and trade-offs to be made, and that can consume a lot of
discussion time. It's much easier to implement something like this than to
write a specification for it that a group of people will all sign up to.

> But that's not the most important at this point.
> What I am looking for is a serialization algorithm I can
> point people to as part of specifying a protocol that returns
> the result of an XPath evaluation.
> I'd like to simply tell them "do what Nux does", but only
> Microsoft gets away with that kind of implementation-centric
> specification language (hello OOXML). Even though it's pretty
> easy to look at the Nux code (the WrapSerializer nested
> class) and figure the algorithm. Or to run a few XPath
> queries through it to see how each node type gets wrapped.
> Still, I'd like to have a plain English description of the
> algorithm. But I haven't been able to find such a thing. Does
> it exist?

No, I don't think so. Nor does a description of the similar-but-different
wrapped serialization in Saxon, or the one in Tamino, or probably half a
dozen others.

Michael Kay

Archive powered by MHonArc 2.6.24.

Top of Page