Re: Context for p:option

Henry S. Thompson wrote:
> Jeni Tennison writes:
> 
>> 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?
> 
> I don't see the analogy -- please expand.

You are processing something (a document in XProc, an element in XSLT), 
and passing an argument to the component doing the processing (a step in 
XProc, a template in XSLT). In both, there is some context (a default 
readable port in XProc, a current node in XSLT) in scope when the 
component is invoked.

In both, the value of the argument is being set using an XPath 
expression. In XSLT, the XPath expression is evaluated relative to the 
current node (context) when you invoke the template, not the element 
that you process with the template. In XProc, I'd expect the XPath 
expression to be evaluated relative to the default readable port, not 
the documents that you process with the step.

Jeni
-- 
Jeni Tennison
http://www.jenitennison.com

Received on Wednesday, 6 June 2007 14:04:41 UTC