Re: Context for p:option

Norman Walsh wrote:
> / ht@inf.ed.ac.uk (Henry S. Thompson) was heard to say:
> | Norman Walsh writes:
> |
> |> For p:input (and its friends: p:iteration-source, etc.) if there's
> |> no explicit binding, the binding is made to the default readable port.
> |> Jeni pointed out, I think correctly, that users will expect a select
> |> expression on p:option to also be bound to the default readable port
> |> by default.
> |>
> |> Anyone disagree?
> |
> | Not strongly, but I think what people will _really_ expect is that it
> | will be bound to the primary input of the step by default.  As long as
> | that input defaults, this makes no difference, but I think users will
> | be surprised if they write
> |
> |  <p:pipeline name="top">
> |   <p:input port="stylesheet"/>
> |   . . .
> |   <p:customize>
> |    <p:input port="primary">
> |     <p:pipe step="top" port="stylesheet"/>
> |    </p:input>
> |    <p:option name="version" select="/xsl:stylesheet/@version"/>
> |    . . .
> |
> | and it doesn't work.
> 
> Indeed.

Really? I don't expect it to work like Henry does at all. The analogous 
situation in XSLT is:

   <xsl:apply-templates select="some/element">
     <xsl:with-param name="strId" select="@id" />
   </xsl:apply-templates>

Do you expect $strId to be set based on the id attribute of the 
element(s) that you apply templates to (some/element), or based on the 
node that you're on when you do the apply templates?

Jeni

Received on Wednesday, 6 June 2007 13:49:57 UTC