[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: for-each issue
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Thu, 27 Mar 2008 17:25:32 +0530
On 3/27/08, Z W <mpc8250@xxxxxxxxx> 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

Current Thread
  • Re: for-each issue, (continued)
      • Z W - 27 Mar 2008 09:55:04 -0000
        • Mukul Gandhi - 27 Mar 2008 10:32:23 -0000
        • Z W - 27 Mar 2008 10:40:23 -0000
        • Z W - 27 Mar 2008 10:53:10 -0000
        • Mukul Gandhi - 27 Mar 2008 11:55:51 -0000 <=
        • Z W - 27 Mar 2008 15:10:59 -0000
        • David Carlisle - 27 Mar 2008 15:18:27 -0000
        • Z W - 27 Mar 2008 15:43:58 -0000
        • XSL-List Owner - 27 Mar 2008 16:12:40 -0000
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member