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

Re: XPaths over document sequences

From: Norman Walsh <Norman.Walsh@Sun.COM>
Date: Thu, 01 Jun 2006 09:49:33 -0400
To: public-xml-processing-model-wg@w3.org
Message-ID: <87k681kmtu.fsf@nwalsh.com>
/ Jeni Tennison <jeni@jenitennison.com> was heard to say:
| Hi,
|
|>    [NEW] ACTION: Norm to record the open issue about what an XPath expression
|>    over a document sequence means [recorded in
|>    http://www.w3.org/2006/05/25-xproc-minutes.html#action01[13]]
|
| On this topic, I'd like to be able to do:
|
|   <p:choose>
|     <p:input name="input" ref="documents" />
|     <p:when test="input contains one or more documents">
|       ...
|     </p:when>

Ok, my first reaction is, for V1 let's make it an error to attempt to
evaluate an XPath over a sequence of documents. :-)

If you know (or think you might) get a sequence, then you can wrap
them in a for-each. Given a component, p:count-documents-in-sequence,
that generates <count>3</count> for a sequence of three documents,
you could write:

<p:step name="p:count-doucments-in-sequence">
  <p:input name="input" ref="documents"/>
  <p:output name="output" label="count"/>
</p:step>

<p:choose>
  <p:when ref="count" test="count &gt; 1">
    <p:for-each-document ...>
    </p:for-each-document>
  </p:when>
  <p:otherwise>
    ...
  </p:otherwise>
</p:choose>

Too odious?

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
XML Standards Architect
Sun Microsystems, Inc.

Received on Thursday, 1 June 2006 13:49:43 GMT

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