W3C home > Mailing lists > Public > xproc-dev@w3.org > June 2010

RE: XPath context of p:wrap-sequence/@group-adjacent

From: <Toman_Vojtech@emc.com>
Date: Tue, 8 Jun 2010 02:18:24 -0400
Message-ID: <997C307BEB90984EBE935699389EC41C01916709@CORPUSMX70C.corp.emc.com>
To: <xproc-dev@w3.org>

I believa that both Calabash and Calumet behave correctly. The
group-adjacent XPath expression (after its value is constructed by the
XProc processor) is passed to and evaluated by the XProc *step*. If you
look at section, where the "step XPath context" is discussed,
you will see that no variable bindings are defined in the step context
(unless otherwise specified by specific steps - see for instance

See section 2.6 in the specification for a brief discussion of the
difference between the processor XPath context and the step XPath


Vojtech Toman
Principal Software Engineer
EMC Corporation

> -----Original Message-----
> From: xproc-dev-request@w3.org [mailto:xproc-dev-request@w3.org] On
Behalf Of
> Romain Deltour
> Sent: Friday, June 04, 2010 11:54 PM
> To: xproc-dev@w3.org
> Subject: XPath context of p:wrap-sequence/@group-adjacent
> Hi XProc-ers,
> Should the in-scope variables and options be available as variable
> binding in the XPath context when evaluating the @group-adjacent
> expression of a p:wrap-sequence step ?
> The spec says: "The XPath context for the group-adjacent option
> changes over time. For each document that appears on the source port,
> the expression is evaluated with that document as the context
> document. The context position (position()) is the position of that
> document within the sequence and the context size (last()) is the
> total number of documents in the sequence."
> but nothing is said about in-scope options and variables... I then
> assume that they should be available (as per the general description
> of XPath context in XProc).
> The following pipeline raises XPathExceptions in both Calabash and
> Calumet, which (as far as I understand) would be a bug:
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="1.0">
>    <p:input port="source" sequence="true">
>      <p:inline>
>        <doc/>
>      </p:inline>
>      <p:inline>
>        <doc/>
>      </p:inline>
>    </p:input>
>    <p:variable name="myvar" select="2">
>      <p:empty/>
>    </p:variable>
>    <p:wrap-sequence wrapper="wrapper" group-adjacent="position() =
> $myvar"/>
>    <p:sink/>
> </p:declare-step>
> Thanks,
> Romain.
Received on Tuesday, 8 June 2010 06:19:42 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:07 UTC