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

cocoon, sql, & xslt

Subject: cocoon, sql, & xslt
From: "Kari M. Scott" <kmscott@xxxxxxxxxxxxxxxx>
Date: Thu, 13 Jul 2000 10:08:20 -0500 (CDT)
cocoon sql
I'm using Cocoon. In my xml file, I query a database and receive the
following results:

+----+------------+-----------------+
| id | name       | project_name    |
+----+------------+-----------------+
|  1 | Customer 1 | Project 1       |
|  2 | Customer 1 | Project 2       |
|  3 | Customer 2 | Project 1       |
+----+------------+-----------------+

In my xsl file, I would like to display something like this:

<B>Customer 1</B>
 <UL>
   <LI>Project 1</LI>
   <LI>Project 2</LI>
 </UL>

<B>Customer 2</B>
 <UL>
   <LI>Project 1</LI>
 </UL>


---------------------------------------------------------
What I don't know how to do is display the customer name once with a list
of projects, so instead I'm getting this:

Customer 1
  Project 1
Customer 1 
  Project 2
Customer 2
  Project 1



Here is a snippet from my xsl file:

  <!-- PROJECTS ===================================================-->
  <xsl:template match="PROJECTS">
      <xsl:apply-templates select="PROROW"/>
  </xsl:template>
  <!-- PROROW ====================================================-->
  <xsl:template match="PROROW">
        <xsl:variable name="id">
          <xsl:value-of select="id"/>
        </xsl:variable>
        <B><xsl:value-of select="name"/></B>
          <UL>
            <LI>
                <a href="projects_results.xml?project={$id}">
                <xsl:value-of select="project_name"/>
                </a>
            </LI>
          </UL>
        <P></P>
  </xsl:template>

---------------------------------------------------------------

Thanks, 
Kari


Kari M. Scott
Berbee
5520 Research Park Drive
Madison, WI  53711-5377
kmscott@xxxxxxxxxx
608.288.3000 ext. 1223
608.298.1223 direct dial
608.288.3037 fax

Berbee...putting the E in business


 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.