|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] cocoon, sql, & xslt
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








