[xsl] question about a non-trivial apply-templates

Subject: [xsl] question about a non-trivial apply-templates
From: "Jaime A Stuardo Bahamondes" <jstuardo@xxxxxxxxxxx>
Date: Thu, 4 Dec 2003 18:45:20 -0400
Hi all..

How can I this? 

I have an XML, for example,

<rowset>
  <row>
    <field1>....</field1>
    <field2>....</field2>
    <field3>1</field3>
  </row>
  <row>
    <field1>....</field1>
    <field2>....</field2>
    <field3>1</field3>
  </row>
  <row>
    <field1>....</field1>
    <field2>....</field2>
    <field3>2</field3>
  </row>
  <row>
    <field1>....</field1>
    <field2>....</field2>
    <field3>2</field3>
  </row>
  <row>
    <field1>....</field1>
    <field2>....</field2>
    <field3>3</field3>
  </row>
  <row>
    <field1>....</field1>
    <field2>....</field2>
    <field3>3</field3>
  </row>
</rowset>

Notice the value of field3 in each <row>.

I want to program an XSL that generates an HTML page that has 3 separate sectors, one for each value of field3. Each sector has exactly the same structure, more or less this way:

sector 1 (when field3 evaluates to 1)
   row1
     label1 = value1
     label2 = value2
   row2
     label1 = value1
     label2 = value1
<blank space>
sector 2 (when field3 evaluates to 2)
   row1
     label1 = value1
     label2 = value2
   row2
     label1 = value1
     label2 = value1
<blank space>
sector 3 (when field3 evaluates to 3)
   row1
     label1 = value1
     label2 = value2
   row2
     label1 = value1
     label2 = value1


I could do it if I generate an XML with the 3 sectors separately and calling apply templates for each, but in this case, that XML is built by mean of an Oracle query, so I cannot modify it.

Any help?
Thanks a lot in advance

Jaime

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


Current Thread