xsl-list
[Top] [All Lists]

Re: [xsl] named template with parameter problem

2008-04-22 14:23:18
Thanks, it's worked.

On Wed, Apr 23, 2008 at 12:10 AM, Scott Trenda 
<Scott(_dot_)Trenda(_at_)oati(_dot_)net> wrote:
Did you mean to pass the string 'utt_chp9_ifc_desc'? The
 <xsl:with-param> is looking for a child element with name
 utt_chp9_ifc_desc, which doesn't exist. Wrap quotes around
 'utt_chp9_ifc_desc' if you're intending a string.

 ~ Scott




 -----Original Message-----
 From: Ilya Lifshits [mailto:chehlo(_at_)gmail(_dot_)com]
 Sent: Tuesday, April 22, 2008 4:08 PM
 To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
 Cc: Ilya Lifshits
 Subject: [xsl] named template with parameter problem

 Hi all,

 I have problem with parameters in named template.


 snippet from xsl file
 --------
 <xsl:template name="j_test_ref">
    <xsl:param name="m_id"/>
    <xsl:param name="t_id"/>
    <xsl:param name="link"/>

    T.<xsl:value-of select='$m_id'/>.<xsl:value-of select='$t_id'/>
    <xsl:element name="xref">
        <xsl:attribute name="xrefstyle">select:
 labelnumber</xsl:attribute>
        <xsl:attribute name="linkend"><xsl:value-of
 select='$link'/></xsl:attribute>
    </xsl:element>
 </xsl:template>


 <xsl:template match="j_interface_desc_test_ref">
    Interface Descriptor test -
    <xsl:call-template name="j_test_ref">
        <xsl:with-param name="m_id" select='1'/>
        <xsl:with-param name="t_id" select='4'/>
        <xsl:with-param name="link" select='utt_chp9_ifc_desc'/>
    </xsl:call-template>
 </xsl:template>

 input xml file
 --------------

 <j_interface_desc_test_ref/>


 output xml file
 ---------------

 T.1.4<xref xrefstyle="select: labelnumber" linkend=""/>

 expected result

 T.1.4<xref xrefstyle="select: labelnumber" linkend="utt_chp9_ifc_desc"/>

 For some reason link parameter is not passed correctly to the
 j_test_ref template.
 I probably missed something simple.

 Thanks for advice
 Ilya.

 --~------------------------------------------------------------------
 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
 To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
 or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
 --~--


 --~------------------------------------------------------------------
 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
 To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
 or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
 --~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>