473,406 Members | 2,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

xml with multiple grouping

I have the following xslt and I am trying to use two levels of
grouping. I am first grouping on the report category, then on the
report type. The problem is I am sure I have to apply some sort of
filter on the report type group to limit the records returned to the
current report category. Any help is appreciated.

<?xml version='1.0' encoding='utf-8' ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:key name="NewDataSet" match="Table" use="report_category"/>
<xsl:key name="report_Type" match="Table" use="report_type"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="NewDataSet">
<table width="400px" style="border-collapse: collapse;Font-family:
tahoma; FONT-SIZE: 10pt; COLOR: black" BORDER="0" cellSPACING="0"
cellpadding="2" >
<tr>
<td width="150px" bgcolor="gainsboro"><b>Category</b></td>
<td width="250px" bgcolor="gainsboro"><b>Report name</b></td>
</tr>
<!-- group by report category -->
<xsl:for-each
select="//Table[generate-id(.)=generate-id(key('NewDataSet',report_category))]">
<xsl:sort select="report_category" order="ascending"/>
<tr height="25px" bgcolor="whitesmoke">
<td colspan="2" style="border-top:solid 1px black; color:Black;
font-weight: bold;">
<xsl:value-of select="report_category"/>
</td>
</tr>
<!-- group by report type -->
<xsl:for-each
select="//Table[generate-id(.)=generate-id(key('report_Type',report_type))]">
<xsl:sort select="report_type" order="ascending"/>
<tr height="25px" bgcolor="whitesmoke">
<td colspan="2" style="border-top:solid 1px black; color:Black;
font-weight: bold;">
<xsl:value-of select="report_type"/>
</td>
</tr>
<xsl:for-each select="key('report_Type',report_type)">
<tr>
<td><xsl:value-of select="report_type"/></td>
<td align="left">
<a
href="Parameters.aspx?REPORT_INDEX={report_index}" ><xsl:value-of
select="report_display_name"/></a>
</td>
</tr>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>

Here is the xml data:
<NewDataSet>
<Table>
<report_index>2</report_index>
<report_type>REPORT</report_type>
<report_display_name>Sales By Product Line</report_display_name>
<report_path>/Customer/Sales/Sales By Product Line</report_path>
<report_category>Sales</report_category>
</Table>
<Table>
<report_index>6</report_index>
<report_type>REPORT</report_type>
<report_display_name>Sales By Product Line with Safety
Breakout</report_display_name>
<report_path>/Customer/Sales/Sales By Product Code
Safety</report_path>
<report_category>Sales</report_category>
</Table>
</NewDataSet>

Nov 12 '05 #1
0 1070

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: reclusive monkey | last post by:
I followed the instructions from the all-knowing Ms. Tennison here; http://www.biglist.com/lists/xsl-list/archives/200101/msg00070.html And it works great for the first two levels. However,...
2
by: Andreas Håkansson | last post by:
Seeing how my previous post seem to have fallen between the cracks, I thought I would have a second, more direct, go at it. So my question is "Is it possible to group (Muenchian method) over...
1
by: Bert_Belgium | last post by:
Hello, I created a database containing several queries on 1 table giving as output the number of records who met certains criteria (= warnings). 1 "grouping" query has as input all the queries...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
6
by: jimfortune | last post by:
In: http://groups.google.com/group/comp.databases.ms-access/msg/60d7faa790c65db1 james.ea...@gmail.com said: :Ok, I've answered the first half of my own question. From a MSDN :article, I...
2
by: pengbsam | last post by:
Hello: I need to write a program that search through multiple level BOM, get all the items. It seems like a easy enough project, but when I put my hands on it and couple of hundred lines of codes...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
2
by: Astrat | last post by:
I am trying to hightlight multiple rows in a report design with specific data. For example, I want to hightlight weekends (i.e. Saturday, Sunday) in yellow. I can accomplish this with the...
9
by: JakeTheSnake | last post by:
Hello, I'm new here, but am really impressed with the positive attitude! I was wondering if someone could give me some help or point me in the right direction. I have a query that returns the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.