Re: p:filter using p:with-option for select

Thanks Martin, that works.

I'm used to using XPath expressions within select attribute on 
p:with-option, to arrive at the value I wish to supply, but hadn't 
noticed that when the expected data type of that option is an 
XPathExpression or XSLTSelectionPattern, it needs to be a string (as 
explained in Standard Step Library § 1. Introduction). Probably because 
when the syntactic shortcut is used to supply the option value via an 
attribute, the quotes aren't required (as explained in An XML Pipeline 
Language § 16.4.3.1. Syntactic Shortcut for Option Values).

Another lesson learned :)

Kind regards,

Sheila

> On 25/04/2026 02:57, Sheila Thomson wrote:
>>
>> The following works as expected:
>>
>> <p:filter select="/*/greeting[3]" />
>>
>> But if I use this variation, both xml-calabash and Morgana throw an 
>> error:
>>
>> <p:filter>
>>      <p:with-option name="select" select="/*/greeting[3]" />
>> </p:filter>
>
>
> Based on the error messages I wonder whether you need
>
> <p:filter>
>     <p:with-option name="select" select="'/*/greeting[3]'" />
> </p:filter>
>

Received on Saturday, 25 April 2026 12:46:58 UTC