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

RE: XSL distinct group by date

Subject: RE: XSL distinct group by date
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 24 Apr 2005 08:56:55 +0100
xsl distinct
Are you familiar with

http://www.jenitennison.com/xslt/grouping

which gives the standard XSLT 1.0 approaches to grouping problems?

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Mindy McCutchan [mailto:karma@xxxxxxxxxxxxxx] 
> Sent: 24 April 2005 03:49
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  XSL distinct group by date
> 
> Hi Everyone,
> I'm very new to XML/XSL, so I'm struggling with something 
> that seems it
> should be fairly straightforward. With the following XML:
> 
> <documents>
> 	<casestudies>
> 		<study id="">
> 			<title />
> 			<date />
> 			<description><![CDATA[ ]]></description>
> 			<pdf />
> 			<logo />
> 		</study>
> 	</casestudies>
> 	<knowledgeadmin>
> 		<pressreleases>
> 			<pressrelease id="">
> 				<title />
> 				<date />
> 				<description><![CDATA[ ]]></description>
> 				<pdf />
> 			</pressrelease>
> 		</pressreleases>
> 		<whitepapers>
> 			<whitepaper id="">
> 				<id />
> 				<title />
> 				<date />
> 				<description><![CDATA[ ]]></description>
> 				<pdf />
> 			</whitepaper>
> 		</whitepapers>
> 	</knowledgeadmin>
> 	<news>
> 		<newsitem id="">
> 			<title />
> 			<date />
> 			<description><![CDATA[ ]]></description>
> 			<fulltext><![CDATA[ ]]></fulltext>
> 		</newsitem>
> 	</news>
> </documents>
> 
> I want to be able to get the different groups (newsitem, whitepaper,
> pressrelease) each grouped by year. Using news as example, I want to
> generate a list of distinct years in news/newsitem/date and 
> make that a URL
> that can be clicked to get the list of newsitems that were in 
> that year. I'm
> open to suggestions on how the date should be formatted. I'm 
> at a stage
> where I can restructure the XML as well, if that appears necessary.
> 
> I'm on Win 2K3 Web Edition server using VBScript. Here is my 
> transformation
> code, which should show the processors/versions used:
> 
> <%
> ' load list of news dats from xml
> Dim oXSL
> Dim myTemplate
> Dim myProc
> Dim oXML
> 				
> set oXML = server.createobject("Microsoft.XMLDOM")
> oXML.async = false
> oXML.load( dbPath )
> 				
> Set oXSL = Server.CreateObject("Msxml2.FreeThreadedDOMDocument.4.0")
> oXSL.async = false
> oXSL.load Server.MapPath("xsl/date_list.xsl")
> 
> ' compliled XSL template
> Set myTemplate = Server.CreateObject("Msxml2.XSLTemplate.4.0")
> myTemplate.stylesheet = oXSL
> 
> Set myProc = myTemplate.createProcessor() myProc.input = oXML
> 
> myProc.output = Response
> myProc.transform()
> %>
> 
> I'm on a very tight deadline and having been 
> trying/researching for several
> hours for a solution to this, so any help would be much appreciated.
> 
> Thank you in advance!
> 
> Mindy

Current Thread

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
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.