This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
cocoon, sql, & xslt
- To: xsl-list at mulberrytech dot com
- Subject: cocoon, sql, & xslt
- From: "Kari M. Scott" <kmscott at pandora dot binc dot net>
- Date: Thu, 13 Jul 2000 10:08:20 -0500 (CDT)
- Reply-To: xsl-list at mulberrytech dot com
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@berbee.com
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