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

Ah, I see... many thanks for the clarification!

Do you know the rationale behind the decision to not bind variables/ 
options to steps XPath context ?

Thanks,
Romain.

Le 8 juin 10 à 08:18, <Toman_Vojtech@emc.com> <Toman_Vojtech@emc.com>  
a écrit :

> Romain,
>
> 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 2.6.1.2, 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
> p:label-elements).
>
> See section 2.6 in the specification for a brief discussion of the
> difference between the processor XPath context and the step XPath
> context.
>
> Regards,
> Vojtech
>
> --
> Vojtech Toman
> Principal Software Engineer
> EMC Corporation
> toman_vojtech@emc.com
> http://developer.emc.com/xmltech
>
>
>> -----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 07:00:11 UTC