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

Re: Kinds of iteration

From: Jeni Tennison <jeni@jenitennison.com>
Date: Thu, 12 Jan 2006 14:22:14 +0000
Message-ID: <155209266.20060112142214@jenitennison.com>
To: public-xml-processing-model-wg@w3.org

Norm wrote:
> |    1.b. ...identified via an (XSLT) pattern (all elements matching the
> |            pattern within one or more documents)
> How is this one different in the pipeline case? And can it be implemented
> by having a component that does the pattern matching? For example, imagine
> that xproc:find-patterns takes some input and produces as output a sequence
> of nodes that match the selected patterns:
>   <xproc:find-patterns>
>     <xproc:select pattern="some-xslt-like-match-pattern"/>
>   </xproc:find-patterns>
> Then if you want to iterate over those you can xproc:for-each over the
> output from that component. Or have I missed the point in some
> fundamental way?

I was just trying to highlight that there are two ways of picking
nodes out of a document in order to iterate over them: through an
XPath select expression (the nodes that are selected) and through an
(XSLT) pattern (the nodes that match). I don't think we need to do
both, rather choose which is easiest to understand:

  <xproc:for-each select="...">...</xproc:for-each>


  <xproc:for-each match="...">...</xproc:for-each>

> |    2.b. ...identified within an XML document, such as an index that
> |            lists the URLs of other XML documents
> So this could be implemented with a component that identified the terms
> in the index and returned the sequence of nodes.

Yes, or it could be part of the pipeline language:

  <xproc:for-each urls="/index/file/@href">...</xproc:for-each>

If we use unrestricted XPath expressions to identify the nodes, then:

  <xproc:for-each select="/index/file/doc(@href)">...</xproc:for-each>

would work, but XSLT patterns couldn't be used in this way.

> |    2.c. ...created as new documents with document elements identified
> |            via 1 above
> I'm not sure how the XPath expressoin can create new documents...

It can't, but you can use XPath expressions to identify the elements
that you want to be deep copied into new documents. This seems to be
what XPL does (from Erik's description [1]).



[1] http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2006Jan/0022.html

Jeni Tennison
Received on Thursday, 12 January 2006 14:55:42 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:32:38 UTC