grouping data by using XSL

wxdqz

New Member
I've the input:-<Root><po><poh_rec po_num="1" po_date="2000-11-01" /><pod_rec item_num="12344" qty="10" /></po><po><poh_rec po_num="1" po_date="2000-11-01" /><pod_rec item_num="12355" qty="05" /></po><po><poh_rec po_num="1" po_date="2000-11-01" /><pod_rec item_num="12366" qty="22" /></po><po><poh_rec po_num="2" po_date="2000-11-01" /><pod_rec item_num="12388" qty="15" /></po><po><poh_rec po_num="2" po_date="2000-11-01" /><pod_rec item_num="12399" qty="12" /></po></Root>And want to have the following output (grouped by 'po_num'):-<Root><po><poh_rec po_num="1" po_date="2000-11-01" /><pod_rec item_num="12344" qty="10" /><pod_rec item_num="12355" qty="05" /><pod_rec item_num="12366" qty="22" /></po><po><poh_rec po_num="2" po_date="2000-11-01" /><pod_rec item_num="12388" qty="15" /><pod_rec item_num="12399" qty="12" /></po></Root>If po_num is unique and can be 1 to n, how the XSL should be. I'm new inthis area but I found some references that I might use <xsl:variable name="x"select="..."/> but not sure how it should construct?Thanks!
 
Back
Top