xsl-list
[Top] [All Lists]

RE: Re:

2004-01-10 09:00:16
Mukul,

I have to agree.  I normally figure this stuff out pretty quickly, but
this one has me completely stumped.  

Hopefully someone will chime in on this.

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Mukul Gandhi
Sent: Saturday, January 10, 2004 3:18 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Re: 

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(_at_)bellsouth(_dot_)net 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



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



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