i'm trying to perform the following steps:
- given the following XML sample
<things>
<thing>
<name>something</name>
<type>abc</type>
<rate>10.00</rate>
</thing>
<thing>
<name>anything</name>
<type>def</type>
<rate>2.00</rate>
</thing>
<thing>
<name>nothing</name>
<type>zyx</type>
<rate>50.00</rate>
</thing>
<thing>
<name>everything</name>
<type>abc</type>
<rate>100.00</rate>
</thing>
</things>
i want to
- sort it by type and then by name
- pass it to a snippet of XSL for processing
- within that snippet, create a table from the results (where the results are grouped by type and the type only appears once at the start of each group), so the output would look like the following:
Things
--------------------------------------------
type: abc | |
--------------------------------------------
name | rate |
everything | 100.00 |
something | 10.00 |
---------------------------------------------
--------------------------------------------
type: def | |
--------------------------------------------
name | rate |
anything | 2.00 |
---------------------------------------------
--------------------------------------------
type: zyx | |
--------------------------------------------
name | rate |
nothing | 50.00 |
---------------------------------------------
how would i go about doing this? i've tried using a sorted copy-of that is sent to the XSL snippet for processing, but the results aren't coming out formatted...also, i've been trying to use preceding-sibling on the sorted list to figure out if i've seen a group header before and not display it if i have (i'm also not using the muenchian (sp?) method, as it is a small dataset), but now i'm thoroughly stuck...help!
p.s.: forgive the sloppiness of the table LOL