call template function called from another xml file?

Discussion in 'XML' started by bjam, Apr 7, 2005.

  1. bjam

    bjam Guest

    Hi, if I want to include a set of call template methods into my xsl
    file can I do that? Meaning I want to have the template method below
    of data_output in another file that I can use in several other xsl
    files when needed. This would be similar to an inclue mindset in C++
    or a import in java. Any help is greatly appreciated. Below I would
    like the "data_output" template call to be imported so to speak or come
    from another xsl file, can this be done using the document method?


    <xsl:template
    match="//item[@key='SUMMARY']/*/item[@key='non_viewable']/*/item[@key='aggregate_result'][text()='true']">
    <xsl:call-template name="data_output"/>
    </xsl:template>

    <!-- data output -->
    <xsl:template name="data_output">
    <tr>
    <xsl:for-each
    select="ancestor::hashref/item[@key='viewable']/hashref/item">
    <a>
    <xsl:attribute name="href">
    http://lx-dgdev51:8080/cgi-bin/<xsl:value-of
    select="/perldata/arguments/display_cgi"/>?file=<xsl:value-of
    select="/perldata/arguments/file"/>&amp;xsl=<xsl:value-of
    select="/perldata/arguments/target_xsl"/>&amp;test=<xsl:value-of
    select="../../../item[@key='non_viewable']/hashref/item[@key='test_value']"/>
    </xsl:attribute>
    <th align='left' bgcolor="lightblue">
    <font color="navy" face='arial' size='2'>
    <xsl:value-of select="text()"/>
    </font>
    </th>
    </a>
    </xsl:for-each>
    </tr>
    </xsl:template>
    bjam, Apr 7, 2005
    #1
    1. Advertising

  2. bjam

    bjam Guest

    I think I just answered my own question with <xsl:import> thanks
    though!
    bjam, Apr 7, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page