using variables in match attribute of p:viewport


I get a Saxon undeclared variable error, when I try to use a reference 
to a variable within a match attribute. So I would like to know if 
in-scope bindings to variables doesn't apply to steps which include a 
match attribute?

Because variable references work in steps with select attribute, it 
would be interesting to know the difference between @match and @select. 
If I missed something in the spec, please let me know.

I made a simple example using p:viewport and p:in-scope-names to show 
the issue. The pipeline fails with: "err:XPST0008:Undeclared variable in 
XPath expression: $foo". If you replace "$foo" with "'bar'" within 
matches(), the result of p:in-scope-names will show that the variable is 
in the scope of p:viewport.

Kind regards,


<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p=""

   <p:input port="source">

   <p:output port="result"/>

   <p:variable name="foo" select="'bar'"/>

   <p:viewport match="//foo[matches(., $foo)]">

     <p:in-scope-names name="in-scope-names"/>

       <p:input port="source">
         <p:pipe port="result" step="in-scope-names"/>



Martin Kraetke
Lead Content Engineer
le-tex publishing services GmbH

Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 143, Fax +49 341 355356 543,

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler

Received on Monday, 1 February 2016 16:18:51 UTC