RE: [xsl] Copy-of question

Subject: RE: [xsl] Copy-of question
From: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 20 Jan 2004 11:13:26 +0200
Hi,

>    <TABLE border="0" cellpadding="0" cellspacing="0" height="5px"
> align="center">
>      <TR>
>          <TD class="LabelBM" style="width:30px">10/03/2004</TD>

WRT HTML output, I'd recommend you lable the TR element with class "LabelBM" and write your CSS using .LabelBM > TD, the generated HTML is cleaner that way.

>         <TD class="LabelBM" style="width:30px">11/03/2004</TD>
>         <TD class="LabelBM" style="width:30px">12/03/2004</TD>
>      </TR>
>     <TR>
>         <TD class="LabelBM" style="width:30px">70.45</TD>
>         <TD class="LabelBM" style="width:30px">90.45</TD>
>         <TD class="LabelBM" style="width:30px">90.55</TD>
>      </TR>
>    </TABLE>
> 
> I do this with XSL:
>                             <TABLE border="0" class="DatosHotel"
> cellpadding="0" cellspacing="0" height="5px" align="center">
> 			           <TR>
>       			             <xsl:for-each 
> select="DETAILS/LDAYS/DAY">

Here you process all the DETAILS in the document. Instead, use

  xsl:for-each DETAILS/LDAYS
    table
      xsl:for-each DAY
        tr
          …
      xsl:for-each DAY
        tr
          …

or if you want everything into the same table, 

  table
    xsl:for-each DETAILS/LDAYS
      xsl:for-each DAY
      tr
        …
      xsl:for-each DAY
      tr
        …
    
> statement? How is
> more eficient, as my way or with a copy statement?

There's nothing to really copy in your transformation because the input and output tree use completely different elements even thought the trees are not unlike in structure.
 
Cheers,

Jarno - Dulce Liquido: Psicosis

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • [xsl] Copy-of question
    • Fran - Tue, 20 Jan 2004 09:54:55 +0100
      • <Possible follow-ups>
      • Jarno . Elovirta - Tue, 20 Jan 2004 11:13:26 +0200 <=