This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Two column HTML output


I have a problem I am not able to figure out.

I have a simple xml file:

<result>
  <row>
     <item>aaaa</item>
     <item>bbbb</item>
     <item>cccc</item>
     <item>dddd</item>
     <item>eeee</item>
              ...
  </row>
</result>

with an arbitrary number of item's.

I want to product HTML output like:

<table>
    <tr>
        <td>
            aaaa
         </td>
        <td>
            bbbb
         </td>
    </tr>
    <tr>
        <td>
            cccc
         </td>
        <td>
            dddd
         </td>
    <tr>
 ...
</table>

(put two <item>s in each <tr> </tr> block).  It is easy enough to put
out each item surrounded by <tr> </tr>.  Because of the necessity to
output proper XML, I am not able to read in the <item>s and if it is in
an odd position emit the <tr> and if it is even position emit the </tr>.

Maybe there is some concept I am not aware of/understand that
I am missing here.

Can anyone help me with an approach to dealing with this kind of
problem?


Thanks,
Dave



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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]