This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem with Passing Parameters to Templates




          <xsl:if test="$node-element">
            <xsl:value-of select="$node-element" />
          </xsl:if>


again, a spurious if. You _never_ need do that. The above is
equivalent to

            <xsl:value-of select="$node-element" />




  <xsl:template name="opt_template">
      <xsl:param name="node"></xsl:param>
           <xsl:variable name="node-element"
                    select=".//*[local-name() = $node]" />
          <xsl:if test="$node-element">
            <xsl:value-of select="$node-element" />
          </xsl:if>
   </xsl:template>


is just



  <xsl:template name="opt_template">
      <xsl:param name="node"/>
      <xsl:value-of select=".//*[local-name() = $node]" />
   </xsl:template>

David

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]