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


From: Norman Walsh <ndw@nwalsh.com>
Date: Sun, 18 May 2008 00:20:27 +0100
To: public-xml-processing-model-wg@w3.org
Message-ID: <m23aogtt50.fsf@nwalsh.com>
The description for p:wrap-sequence says:

  The group-adjacent option can be used to group adjacent documents.
  The specified XPath expression is evaluated for each document with
  that document as the XPath context node. Whenever two or more
  sequentially adjacent documents have the same “group adjacent”
  value, they are wrapped together in a single wrapper element.

Now consider:

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
  <p:input port="source" sequence="true">
    <p:inline><doc1 role="a"/></p:inline>
    <p:inline><doc2 role="a"/></p:inline>
    <p:inline><doc3 role="b"/></p:inline>
    <p:inline><doc4 role="b"/></p:inline>
    <p:inline><doc5 role="b"/></p:inline>
    <p:inline><doc6 role="a"/></p:inline>
  <p:output port="result"/>

  <p:wrap-sequence wrapper="wrapper" group-adjacent="/*/@role"/>

The group adjacent value of the first and second documents of that
sequence are both the attribute <<role="a">>. But of course those two
attributes are not the "same value" in the strictest sense because
they are two different attributes.

I expect that would surprise most users, though they could fix it
with string().

I think the current description is under-specified at best.

Also, what does it mean if the group-adjacent expression returns a

I propose that we say:

  - It is an error if the group-adjacent expression returns a sequence
  - In an XPath 1.0 impl, the string-values of each expression are compared
  - In an XPath 2.0 impl, the ... uh? atomic value? ... of each expr are compared

                                        Be seeing you,

Norman Walsh <ndw@nwalsh.com> | It is necessary to try to surpass
http://nwalsh.com/            | oneself always; this occupation ought
                              | to last as long as life.--Christina,
                              | Queen of Sweden

Received on Sunday, 18 May 2008 19:59:51 UTC

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