W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > June 2007

Re: Context for p:option

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 06 Jun 2007 15:04:36 +0100
Message-ID: <4666BEF4.8010508@jenitennison.com>
To: public-xml-processing-model-wg@w3.org

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 Tennison
Received on Wednesday, 6 June 2007 14:04:41 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:32:43 UTC