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

Meunchen Grouping - How to combine two specific 'uniqu

Subject: Meunchen Grouping - How to combine two specific 'unique' group types?
From: "Karlmarx Rajangam" <karlmarx.rajangam@xxxxxxxxxxxxxxxxxx>
Date: Tue, 8 May 2007 12:23:33 -0400
 Meunchen Grouping - How to combine two specific 'uniqu
Hello,

I am using Muenchen group method for a specific case and have a
requirement of combining / merging two specific group types. Basically
the xml [stripped down] is like

<somenodes>
            <activeSchedule>
                        <assessmentType>Exam</assessmentType>
                        <assessmentName></assessmentName>
                        <scheduleName>Exam All QTypes</scheduleName>
                        <monitor>..</monitor>
                        List of few other nodes
            </activeSchedule>
            <activeSchedule>
                        <assessmentType>Quiz</assessmentType>
                        <assessmentName>Quiz 1</assessmentName>
                        <scheduleName>Quiz 1, unlimited</scheduleName>
                        List of few other nodes
            </activeSchedule>
            <activeSchedule/>
            <activeSchedule/>

The <assessmentType>'s are Exam, NOTSET, Quiz etc and I am grouping them
based on <assessmentType> using Muenchen method. My striped down xslt
code [pls ignore any spell and case mistakes and missing node values if
any]

Seting the key
  <xsl:key name="schedule-by-assessmentType" match="activeSchedule"
use="assessmentType"/>

and then from the main template
  <xsl:apply-templates select="//activeSchedule[generate-id(.) =
generate-id(key('schedule-by-assessmentType', assessmentType)[1])]"/>

and then
  <xsl:template match="activeSchedule">
         <table> blah blah..to display those grouped <assessmentType>
values in a table.

The current html output will look like:

Exam (total  = 3)
    <assessmentName>     <scheduleName>     <EndDate> [& few other field
columns not shown in the xml]
     [3 rows of values]

NOTSET*** (total  = 2)
     <assessmentName>      <scheduleName>       <EndDate>

Quiz (total = 6)
    <assessmentName>      <scheduleName>       <EndDate>


But in our requirement, we must treat 'NOTSET'*** as 'Exam' and combine
them together. i.e., to show something like

Exam (total  = 5)
    <assessmentName>      <scheduleName>     <EndDate>
    [5 rows of values - 3 from Exam + 2 from NOTSET]

I am not sure whether it is possible to achieve that? Pls suggest ways
and means to achieve i.e., combine NOTSET and Exam, without affecting
the rest of the grouping. We use XSLT 1.


Thanks in adv,
Karl

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.