xsl-list
[Top] [All Lists]

Re: [xsl] for-each issue

2008-03-27 04:55:55
On 3/27/08, Z W <mpc8250(_at_)gmail(_dot_)com> wrote:
1- Because this
<td>
code below is getting larger
</td>
how do I do a call-template and passing in with this variable 
cib_time_duration
and perform its task there in another template ?
I ask cuz I like to shorten the <td> section here.

You can refactor the code in <td> into another template. For e.g., as below:

<td>
   <xsl:call-template name="generateInfo">
      <xsl:with-param name="x" select="value" />
   </xsl:call-template>
</td>

<xsl:template name="generateInfo">
   <xsl:param name="x" />

   <!--
      Generate whatever info you want here.
   -->
</xsl:template>


2- l have several input xml files that would fill in this <td> section.
Is it possibe in XSLT to determine which output to display based on
a particular xml input file. Each of these input file would be going
through the same for-each to find its timeSpan.

This seems like a normal control flow requirement, which should be
easy to solve. If you could tell the requirement in detail, we could
possibly suggest some way to solve it.


-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
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>
--~--