Re: No port attribute allowed on p:with-input of p:if?

Hi Martin,

You are right. The spec needs to explicitly state that a p:with-input on 
p:if is always anonymous, that is, no port may be specified in it.

The spec needs to a) explicitly define what it means by “anonymous input 
port“, it needs to b) say that p:with-input must not have a port 
attribute when used in p:viewport, p:for-each, p:choose, p:when, or p:if.
Thirdly unless the list was updated when fixing b), the spec needs to 
add p:if to the list in the bullet point “In a p:choose or p:when, it is 
a binding for the context item for the test expression(s).” of 
https://spec.xproc.org/master/head/xproc/#p.with-input

I’m going to file an issue at https://github.com/xproc/3.0-specification

And yes, in Erik’s book it should read “do not use a port attribute” 
(sloppy proofreading on my part, too…).

Gerrit

On 08.05.2020 20:01, Martin Honnen wrote:
> 
> I have tried to run some XProc 3 code doing
> 
>    <p:if test="$some-variable">
>      <p:with-input port="source" pipe="foo@bar"/>
> 
> Morgana XProc (tested with MorganaXProc-IIIse 0.9.2.6-beta) then tells me
> 
> Error XS0010 in ...: Attribute 'port' not allowed on p:with-input as
> child of p:if.
> 
> That left me puzzled and I tried to find it outlined in
> https://spec.xproc.org/master/head/xproc/#p.if but I can't.
> 
> Erik's book tells me "Do not use a name attribute (the input port is
> anonymous).".
> 
> I supposed that is meant to tell me "Do not use a port attribute".
> 
> So I get my code to run by omitting the "port" attribute with e.g.
> 
>    <p:if test="$some-variable">
>      <p:with-input pipe="foo@bar"/>
> 
> 
> Shouldn't the spec somehow state that the "port" attribute on
> "p:with-input" of a "p:if" is not allowed or define that the input port
> is anonymous?
> 
> 

Received on Saturday, 9 May 2020 05:26:54 UTC