sort/group/count problem

Subject: sort/group/count problem
From: "Xu, Xiaocun" <XXu@xxxxxxxxxxxxxxxxxx>
Date: Sat, 4 Nov 2000 22:45:24 -0500

  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
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

original XML document:
			<division>RETAIL BRAND 001</division>

 XSL-List info and archive:

Current Thread