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

Re:

Subject: Re:
From: Mukul Gandhi <mukulgandhi2003@xxxxxxxxxxx>
Date: Sat, 10 Jan 2004 08:18:13 +0000 (GMT)
xslt node set msxsl
After trying to solve the problem, I feel, this
problem is difficult to solve.. Here is the XSLT I
tried ;)

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:output method="html" version="1.0"
encoding="UTF-8" indent="yes"/>
	
<xsl:key name="x" match="/School/Grade" use="Name"/>
<xsl:key name="y" match="" use="" /> <!-- ?? -->
	
<xsl:template match="/School">
  <xsl:variable name="gradeRTF">
    <xsl:for-each select="Grade">
	<xsl:if test="generate-id(.) = generate-id(key('x',
Name)[1])">
	   Grade: <xsl:value-of select="Name"/>
	</xsl:if>
    </xsl:for-each>
  </xsl:variable>
		
  <xsl:value-of select="msxsl:node-set($gradeRTF)/."
/>
  <!-- process the node-set; Apply Muenchian grouping
to the node-set -->

</xsl:template>

</xsl:stylesheet>

There should be a key defined, from the node-set
msxsl:node-set($gradeRTF). Lets assume, the key name
is 'y' .. But we cannot define xsl:key below
<xsl:value-of select="msxsl:node-set($gradeRTF)/." />
, which IMO is required, to solve the problem ;)

Can somebody, please shed some light, on the problem
;)

Regards,
Mukul

 --- kakridge@xxxxxxxxxxxxx wrote: > I have been
having a problem with grouping.  If I
> have:
> 
> <School>
> 	<Grade>
> 		<Students>
> 			<Student>
> 				<Name>Bob</Name>
> 				<Tutor>Mary Smith</Tutor>
> 			</Student>
> 			<Student>
> 				<Name>Joe</Name>
> 				<Tutor>Mike Smith</Tutor>
> 			</Student>
> 		<Students>
> 		<Name>Kindergarten</Name>
> 	</Grade>
> 	<Grade>
> 		<Students>
> 			<Student>
> 				<Name>Ted</Name>
> 				<Tutor>Mary Smith</Tutor>
> 			</Student>
> 			<Student>
> 				<Name>Sammy</Name>
> 				<Tutor>Mike Smith</Tutor>
> 			</Student>
> 		</Students>
> 		<Name>First</Name>
> 	</Grade>
> </School>
> 
> How can I group each grade, and within each grade,
> group all tutors with
> their students?
> 
> Something like this:
> 
> Grade: Kindergarten
> Tutor: Mary Smith
> Students: Bob,.,.,.
> 
> Grade: Kindergarten
> Tutor: Mike Smith
> Students: Joe,.,.,.
> 
> Grade: First
> Tutor: Mary Smith
> Students: Ted,.,.,.
> 
> etc.
> 
> Thanks
> 
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
>  

________________________________________________________________________
Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • [no subject]
    • kakridge - Fri, 9 Jan 2004 18:17:45 -0500 (EST)
      • Wendell Piez - Fri, 9 Jan 2004 19:06:16 -0500 (EST)
        • kakridge - Fri, 9 Jan 2004 19:51:00 -0500 (EST)
      • Mukul Gandhi - Sat, 10 Jan 2004 01:37:41 -0500 (EST)
      • Mukul Gandhi - Sat, 10 Jan 2004 03:18:51 -0500 (EST) <=
        • kakridge - Sat, 10 Jan 2004 11:00:55 -0500 (EST)
          • kakridge - Sat, 10 Jan 2004 12:30:28 -0500 (EST)
          • kakridge - Sat, 10 Jan 2004 21:33:22 -0500 (EST)
          • G. Ken Holman - Sun, 11 Jan 2004 13:39:28 -0500 (EST)

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.