xsl-list
[Top] [All Lists]

RE: [xsl] Using XSLT 1.0 , I have tried using the Meunchian methodsolutions on

2006-12-19 15:02:41
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))

hth,
b.

-----Original Message-----
From: Robert.A Greene 
[mailto:Robert(_dot_)A(_dot_)Greene(_at_)state(_dot_)tn(_dot_)us]
Sent: Tuesday, December 19, 2006 1:37 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Using XSLT 1.0 , I have tried using the Meunchian
methodsolutions on

Using XSLT 1.0 , I have tried using the Meunchian method solutions on
the list but I can not get the following to group by FilingType then
AgencyName:

<MonthlyTARList>
<FilingType>Rulemaking Hearings</FilingType>
<AgencyName>Agriculture</AgencyName>
<Filing>0080-06-14 Pest Control Operators</Filing>

<Link>http://www.tn.gov/sos/rules_hearingnotices/2006/0080/0080.20061114
.1
1-05-06.notice.pdf</Link>
</MonthlyTARList>
<MonthlyTARList>
<FilingType>Rulemaking Hearings</FilingType>
<AgencyName>Agriculture</AgencyName>
<Filing>0080-06-15 Interior Designers</Filing>

<Link>http://www.tn.gov/sos/rules_hearingnotices/2006/0120/0120.20061130
.1
1-27-06.notice.pdf</Link>
</MonthlyTARList>

So that the file reads:

Rulemaking Hearings
Agriculture
0080-06-14 Pest Control Operators
0080-06-15 Interior Designers

What I have so far (grouping by FilingType only):

<xsl:key name="tar_by_filingtype" match="MonthlyTARList"
use="FilingType"/><xsl:template match="dataroot">

<xsl:for-each select="MonthlyTARList[count(. |
key('tar_by_filingtype',
FilingType)[1])=1]">
    <xsl:sort select="FilingType" />
           <div class="headline1_xml"><xsl:value-of
select="FilingType"/></div>
    <xsl:for-each select="key('tar_by_filingtype', FilingType)">
          <div class="text_xml"><xsl:value-of
select="AgencyName"/></div>
        <div><xsl:value-of select="Filing"/></div>

thanks for any help,


Robert Greene
Tennessee Department of State
Division of Publications
312 8th Ave. North, 8th Floor
Nashville, TN 37243
(615) 253-4571
FAX (615) 741-5133
http://www.tennessee.gov/sos

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>