W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > January 2006

Kinds of iteration

From: Jeni Tennison <jeni@jenitennison.com>
Date: Tue, 10 Jan 2006 17:02:10 +0000
Message-ID: <823354813.20060110170210@jenitennison.com>
To: public-xml-processing-model-wg@w3.org

Hi,

I thought I'd try to summarize the different kinds of iteration that
we've discussed.

1. Iteration over a sequence of elements...

   1.a. ...identified via an XPath expression (selected from one or
           more documents)

   1.b. ...identified via an (XSLT) pattern (all elements matching the
           pattern within one or more documents)

2. Iteration over a sequence of documents...

   2.a. ...generated by an upstream process, such as an XQuery whose
           result is a sequence of document nodes
           
   2.b. ...identified within an XML document, such as an index that
           lists the URLs of other XML documents

   2.c. ...created as new documents with document elements identified
           via 1 above

Some thoughts:
           
The distinction between 1 and 2.c is important because the context of
the element is lost when you copy an element into a new document: both
its ancestors and its base URI are different. XSLT expects an "initial
context node", which can be any node kind, not only a document (and
not only an element), and given that XSLT is one of the main kinds of
component we probably want to support that (in the Processing Model if
not the Processing Language).

If we support 2.a, we don't necessarily have to have a construct in
the Processing Language for 2.b or 2.c: it's easy to write a process
(in XQuery or XSLT, for example) that does 2.b or 2.c. (Again, we have
the tension between putting control structures in the pipeline
language and putting them into the processes themselves.)

Cheers,

Jeni
---
Jeni Tennison
http://www.jenitennison.com/
Received on Tuesday, 10 January 2006 17:02:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:46 GMT