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

Grouping Problem


grouping problem
Hi Everyone,
I'm little stuck in a grouping problem.I'm sure
someone can help me on this list.This list has really
been very supportive.Thanks for all the help.

Here is my XML document,
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="example1.xsl"?>
<dataroot
xmlns:od="urn:schemas-microsoft-com:officedata"
generated="2003-10-15T12:22:08">
<GrantNet>
<Issue_x0020_Number>0005</Issue_x0020_Number>
<Handout_x0020_Number>111</Handout_x0020_Number>
<fldCatID>GS</fldCatID>
<fldSponsorDesc>American Association of University
Women</fldSponsorDesc>
<Program>2000-2001 American Fellowships</Program>
<URL>http://www.aauw.org/3000/fdnfelgra.html</URL>
<Description></Description>
<Deadline_x0020_Date>1999-11-15T00:00:00</Deadline_x0020_Date>
<Program_x0020_Source>Web</Program_x0020_Source>
<Date_x0020_of_x0020_Notice>1999-10-11T00:00:00</Date_x0020_of_x0020_Notice>
</GrantNet>

<GrantNet>
<Issue_x0020_Number>0103</Issue_x0020_Number>
<Handout_x0020_Number>752</Handout_x0020_Number>
<fldCatID>ID</fldCatID>
<fldSponsorDesc>American Council of Learned
Societies</fldSponsorDesc>
<Program>Library of Congress Fellowships in
International Studies</Program>
<URL>http://www.acls.org</URL>
<Description></Description>
<Deadline_x0020_Date>2000-10-02T00:00:00</Deadline_x0020_Date>
<Program_x0020_Source>Mailing from
Sponsor</Program_x0020_Source>
<Date_x0020_of_x0020_Notice>2000-08-25T00:00:00</Date_x0020_of_x0020_Notice>
</GrantNet>

<GrantNet>
<Issue_x0020_Number>0103</Issue_x0020_Number>
<Handout_x0020_Number>753</Handout_x0020_Number>
<fldCatID>ID</fldCatID>
<fldSponsorDesc>American Council of Learned
Societies</fldSponsorDesc>
<Program>Contemplative Practice Fellowships</Program>
<URL>http://www.acls.org</URL>
<Description></Description>
<Deadline_x0020_Date>2000-11-01T00:00:00</Deadline_x0020_Date>
<Program_x0020_Source>Mailing from
Sponsor</Program_x0020_Source>
</GrantNet>

<GrantNet>
<Issue_x0020_Number>0101</Issue_x0020_Number>
<Handout_x0020_Number>606</Handout_x0020_Number>
<fldCatID>SB</fldCatID>
<fldSponsorDesc>A.L. Mailman Family Foundation,
Inc.</fldSponsorDesc>
<Program>Foundation Grants</Program>
<URL>http://www.mailman.org</URL>
<Description></Description>
<Deadline_x0020_Date>2001-01-15T00:00:00</Deadline_x0020_Date>
<Program_x0020_Source>Other</Program_x0020_Source>
<Date_x0020_of_x0020_Notice>2000-06-26T00:00:00</Date_x0020_of_x0020_Notice>
</GrantNet>
</dataroot>

My XSL is
<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/TR/REC-html40">

<xsl:key name="rows" match="GrantNet" use="fldCatID"
/>

<xsl:output method ="html"/>

<xsl:template match="dataroot">
 <HTML>
    <HEAD>
       <TITLE>GrantNet</TITLE>
    </HEAD>
    <BODY>
<A NAME="TOP"/>	
<h2 align="center"><font color="#800000">Office Of
Research and Sponsored Programs<BR/><BR/>GrantNet
Month 2003</font></h2><BR/>
<p align="left"><font color="#004080" face="Times New
Roman"><a name="Sorted by Disciplines"><big>Sorted by
Disciplines</big></a></font> </p>

<p align="left"><font face="Times New Roman">
<a href="#fldCatID"><big>AH - Arts &amp;
Humanities</big></a><br/>
<a href="#fldCatID"><big>ED - Education</big></a><br/>
<a href="#fldCatID"><big>GS - Graduate Student
</big></a><br/>
<a href="#fldCatID"><big>HM - Health &amp;
Medicine</big></a><br/>
<a href="#fldCatID"><big>ID -
Interdisciplinary</big></a><br/>
<a href="#fldCatID"><big>IN - International
Programs</big></a><br/>
<a href="#fldCatID"><big>SB - Social and Behavioral
</big></a><br/>
<a href="#fldCatID"><big>SEM - Science, Engineering
&amp; Math<br/>
</big></a></font> </p>
<xsl:apply-templates/>	
 
</BODY>
  </HTML>    
</xsl:template>

<xsl:template match="GrantNet">
<xsl:apply-templates select="GrantNet[generate-id(.) =
generate-id(key('rows', fldCatID)[1])]"/>

<xsl:apply-templates select="fldCatID"/>-
<B><xsl:apply-templates
select="Handout_x0020_Number"/></B><br/>
<font color="#0000FF"><xsl:apply-templates
select="fldSponsorDesc"/></font><br/>
 <B><U><xsl:apply-templates
select="Program"/></U></B><br/><br/>
  <xsl:apply-templates
select="Description"/><br/><br/>

<P><I><font color="#0000FF">
	<A TARGET="_blank">
	<xsl:attribute name="HREF">
	<xsl:apply-templates select="URL"/>
	</xsl:attribute>
	<xsl:apply-templates select="URL"/>
	</A>  
        </font>
</I><br/></P>

<xsl:apply-templates
select="Deadline_x0020_Date"/><br/>

<br/><hr/><p><center>[<a
href="#TOP">TOP</a>]</center></p><hr/>

</xsl:template>

</xsl:stylesheet>

I'm trying to group it by fldCatID but nothing seems
to heppen.I tried using 
<xsl:apply-templates select="GrantNet[generate-id(.) =
generate-id(key('rows', fldCatID)[1])]"/>
but looks like I'm missing something.

Any help is appreciated a lot.Thanks in advance.
Regards,
Puja.


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.