Subject: RE: [xsl] Using XSLT 1.0 , I have tried using the Meunchian methodsolutions on From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 19 Dec 2006 18:38:57 -0500 |
A quick and dirty way:
<xsl:if test="position() = 1"> <div> <xsl:value-of select="AgencyName"/> </div> </xsl:if>
This will display AgencyName only on the first occurrence of the nodes selected by your key.
Note, however, that your key only groups by FilingType--if you have multiple AgencyNames with the same FilingType only the first occurrence of AgencyName will appear.
You can fix this by expanding your key:
<xsl:key name="tar_by_filingtype" match="MonthlyTARList" use="concat(FilingType, ' ', AgencyName)"/>
Then change your for-each to use
key('tar_by_filingtype', concat(FilingType, ' ', AgencyName))
<xsl:for-each select="key('tar_by_filingtype', concat(FilingType, ' ', AgencyName))[1]"> <!-- note predicate in select expression --> <div> <xsl:value-of select="AgencyName"/> </div> </xsl:for-each>
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Using XSLT 1.0 , I have t, Brian Martinez | Thread | RE: [xsl] Using XSLT 1.0 , I have t, Wendell Piez |
RE: [xsl] key() and document() - sc, Bryn Lewis | Date | RE: [xsl] key() and document() - sc, Wendell Piez |
Month |