Re: [xslt] RE: xslt digest, Vol 1 #53 - 2 msgs



Le 08/06/01 02:49:24, ±èÀº¿µ a écrit :

First, I'd say this list is not the proper place for these discussions.
Please discuss of XSLT understanding issues in an generalist XSLT mailing
list or news group (comp.text.xml).

>  <xsl:param name="tag1"/>
>  <xsl:param name="tag2"/>
>  
>  <xsl:template match="/">
>      First Value : <xsl:value-of select="$tag1"/>
>     Second Value : <xsl:value-of select="$tag2"/>
>  </xsl:template>
>  ...
> 
> xml)
> <test>
>    <aaa> You got the node1 </aaa>
>    <bbb> You got the node2 </bbb>
>    <ccc> You got the node3 </ccc>
>    <ddd> You got the node4 </ddd>
> </test>
> 
>  xsltproc --param tag1 aaa --param tag2 ddd test.xsl test.xml

Global parameter and variable values are computed at top-level, with the
rules defined in XSLT 1.0, 11.4 Top-level Variables and Parameters:
  «At top-level, the expression or template specifying the variable value
is evaluated with the same context as that used to process the root node of
the source document: the current node is the root node of the source
document and the current node list is a list containing just the root node
of the source document.»
So, aaa is equivalent to /aaa, and /aaa evaluates to an empty node-set,
hence an empty string-value and an empty result.
Use test/aaa or /test/aaa

Tom.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]