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



> And the xsl file will be something like:

easier if you give complete example

something like:

<z>
<codec>1234</codec>
<desc>5678</desc>
</z>





<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0"
                >

<xsl:output method="xml" indent="yes"/>


<xsl:template match="/">

     <xsl:call-template name="opt_template">
         <xsl:with-param name="node"  select="'codec'"/>
     </xsl:call-template>

     <xsl:call-template name="opt_template">
         <xsl:with-param name="node"  select="'desc'"/>
     </xsl:call-template>

</xsl:template>

     <xsl:template name="opt_template">
        <xsl:param name="node"></xsl:param>

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

     </xsl:template>

</xsl:stylesheet>



bash-2.01$ xt codec.xml codec.xsl 
<?xml version="1.0" encoding="utf-8"?>


      [1234]

     

      [5678]

     bash-2.01$ 

 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]