- From: Norman Walsh <Norman.Walsh@Sun.COM>
- Date: Thu, 01 Jun 2006 09:43:05 -0400
- To: public-xml-processing-model-wg@w3.org
- Message-ID: <87odxdkn4m.fsf@nwalsh.com>
/ Jeni Tennison <jeni@jenitennison.com> was heard to say: | What I don't understand is how things are actually all that better when | the input is referenced by setting the context node instead. The above | would look like (|s indicate changed lines): | | <p:choose> | <p:input name="input" /> | | <p:output name="output" ref="output" /> | | <p:variable name="xsl-stylesheet-pi" context="input" | | select="processing-instruction('xsl-stylesheet')" /> | <p:when test="$xsl-stylesheet-pi and | contains($xsl-stylesheet-pi, | 'type="text/xsl"')"> | ... | </p:when> | <p:otherwise> | ... | </p:otherwise> | </p:choose> | | The implementation still has to look inside the condition XPath to | work out that $xsl-stylesheet-uri has been referenced. I'm not sure it has to do that. It knows from the "context" attribute that it has to build the flow graph such that "input" is available before it evaluates the condition. In this case, the input is certainly going to be available because the variable depends on an explicit input. But consider: <p:step name="load"> <p:param href="document" value="/path/to/input1.xml"/> <p:output name="out1"/> </p:step> <p:step name="load"> <p:param href="document" value="/path/to/input2.xml"/> <p:output name="out2"/> </p:step> <p:step name="somethingElse"> <p:param name="counter" select="count($out1//chapter)"/> </p:step> In order to ascertain that the load that supplies $out1 has to complete before the "somethingElse" step is run, the pipeline has to examine the XPath expressions to determine what variables are referenced, if they're references to inputs or outputs in the current scope, etc. But with: <p:step name="load"> <p:param href="document" value="/path/to/input1.xml"/> <p:output name="out1"/> </p:step> <p:step name="load"> <p:param href="document" value="/path/to/input2.xml"/> <p:output name="out2"/> </p:step> <p:step name="somethingElse"> <p:param name="counter" ref="out1" select="count(//chapter)"/> </p:step> It's clear that somethingElse depends on the out1 document. I think this is simpler and easier to explain and understand. But I'll reluctantly admit that it may be no more than a simple matter of programming on the implementations behalf to work this out from the previous syntax. | It's then | easier to work out that this variable references the input to the | <p:choose>, but the implementation still has to look for variable | references within the XPath expression used to set the | $xsl-stylesheet-pi variable in case other variables (which might rely | on other documents) have been referenced. But if they relied on other documents, those too would have to have been explicitly 'ref'd and so we could be sure they were available before starting execution of this step. Be seeing you, norm -- Norman Walsh XML Standards Architect Sun Microsystems, Inc.
Received on Thursday, 1 June 2006 13:43:22 UTC