This is a standard grouping problem, look up "grouping" or "Muenchian
grouping" in your favourite XSLT textbook, or read
http://www.jenitennison.com/xslt/grouping
Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com
-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of
Teresa Van Meter
Sent: 18 December 2002 12:57
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Rendering XML
Hi:
I have the following XML file:
<npc id="1">
<p desc="desktop" mpn="123" price="29.99"
vendor="xxx.com"/>
<p desc="chair" mpn="654" price="12.99"
vendor="xxx.com"/>
<p desc="desktop" mpn="123" price="27.99"
vendor="yyy.com"/>
<p desc="desktop" mpn="123" price="30.99"
vendor="zzz.com"/>
<p desc="table" mpn="389" price="45.99"
vendor="xxx.com"/>
</npc>
and I'd like to generate the following output but I
haven't figure it out yet.
Any ideas??
Thanks.
<npc id="1">
<p desc="desktop" mpn="123">
<pdet price="29.99" vendor="xxx.com"/>
<pdet price="27.99" vendor="yyy.com"/>
<pdet price="30.99" vendor="zzz.com"/>
</p>
<p desc="chair" mpn="654" price="12.99"
vendor="xxx.com"/>
<p desc="table" mpn="389" price="45.99"
vendor="xxx.com"/>
</npc>
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list