This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
sort/group/count problem
- To: "''xsl-list at mulberrytech dot com ' '" <xsl-list at mulberrytech dot com>
- Subject: sort/group/count problem
- From: "Xu, Xiaocun" <XXu at CommercialWare dot com>
- Date: Sat, 4 Nov 2000 22:45:24 -0500
- Reply-To: xsl-list at mulberrytech dot com
Hi,
I currently have a XML document with the attached structure, my goal is to
sort/group/count based on the information in the elements. My questions
are:
1. Is the XML structure attached efficient? Should I put most of the
elements, such as all children of <item>, to be attributes instead?
2. How should I sort all items within each batch based on itemid, and
display each of the group separately?
3. How should I count all distinctive itemid within each batch?
I was able to figure out "count(//itemid[not(.=preceding::itemid)])" count
all disctinctive itemid, but it was for all items in the XML document, not
within the scope of each batch.
Any suggestions much appreciated,
Xiaocun Xu
xxu@commercialware.com
original XML document:
<batchlist>
<batch>
<batchid>102</batchid>
<date>09/29/2000</date>
<itemlist>
<item>
<itemid>Z1000</itemid>
<description>PILLOW</description>
<duedate>09/29/2000</duedate>
<division>RETAIL BRAND 001</division>
<orderid>00001113-001</orderid>
<poid>0000881</poid>
<units>1</units>
<cmz>N</cmz>
</item>
<item>...</item>
</itemlist>
</batch>
<batch>...</batch>
</batchlist>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list