[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

question about a non-trivial apply-templates

Subject: question about a non-trivial apply-templates
From: "Jaime A Stuardo Bahamondes" <jstuardo@xxxxxxxxxxx>
Date: Thu, 4 Dec 2003 18:45:20 -0400
non trivial question
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.