Re: Issue #3306

Jeni Tennison wrote:

 > 2. Say that XProc inputs and outputs are sequences with no duplicates,
 > and, when translated into XPath datatypes, that the document order of
 > the root nodes is determined by their order in the sequence

I am not sure we need the concept of "sequences with no duplicates",
see below.

 > 3. Define an XPath 1.x that supports sequences, and use that in XProc

 > Option 3 is the worst of these options, in my opinion, since it involves
 > a lot of effort on our part and would be foreign to any users.

I agree.

 > I could live with any of the others, and currently have a vague
 > preference for Option 1.
 >
 > Do people have examples of components that produce sequences of
 > documents where (a) the order of the documents within that sequence
 > matters and/or (b) the sequence can contain duplicate documents? I would
 > have thought such components could/should be written with multiple input
 > ports, but I'm not sure.

XPath 1.0 and XSLT 1.0 do not make the best use for the term "set",
because order is clearly implied as you can write
"$my-nodeset[12]". Nodes in a set have an order: 1) document order
within the same document, and 2) when using document(), the order
between documents is left to the implementor.

This is why I said we don't need to invent anything: if a step is
producing dynamically 10 documents, we just define that it actually
produces a node-set containing the root nodes of the 10 documents, in
the order the processor produced them. This is going to be the most
common use case and things will work as expected.

Now the uncommon use-case would be the case where we have "the same"
document produced multiple times by a step. But how do we define this?
Clearly, in XSLT, if I have a.xml and b.xml with the same content,
that doesn't qualify as "the same document". What does actually matter
is that the documents have the same URL:

   "Two documents are treated as the same document if they are
    identified by the same URI. The URI used for the comparison is the
    absolute URI into which any relative URI was resolved and does not
    include any fragment identifier. One root node is treated as the
    same node as another root node if the two nodes are from the same
    document."

However, what does it mean in XProc for a step to produce "the same
document"? Do produced documents have URLs now? If so, then we can
apply the same logic as XSLT does. If not, then we don't have a
problem at all.

-Erik

-- 
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/

Received on Monday, 5 June 2006 17:36:13 UTC