Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSL help. 2

Status
Not open for further replies.

angushirose

Programmer
Feb 14, 2007
1
GB
Hi ,
I'm an XSL newbie and I need help big style.

Below is a copy of an XML file that I need to process :
<ace_samples source="dispatch" toutput="2007-02-01T13:10:28">
<tube>
<pid>100034797</pid>
<barcode>0010000581614</barcode>
<tswipe>2006-09-29T16:08:45</tswipe>
<acid>1</acid>
<author>AYOUNG</author>
<tsig>2006-09-29T16:09:25</tsig>
<cid>667</cid>
<trid>852</trid>
</tube>
<tube>
<pid>100034797</pid>
<barcode>0040000017080</barcode>
<tswipe>2006-09-29T16:08:59</tswipe>
<acid>1</acid>
<author>AYOUNG</author>
<tsig>2006-09-29T16:09:25</tsig>
<cid>667</cid>
<trid>852</trid>
</tube>
<tube>
<pid>100034797</pid>
<barcode>0050000008354</barcode>
<tswipe>2006-09-29T16:08:40</tswipe>
<acid>1</acid>
<author>AYOUNG</author>
<tsig>2006-09-29T16:09:25</tsig>
<cid>667</cid>
<trid>852</trid>
</tube>
<tube>
<pid>100034797</pid>
<barcode>0070000013256</barcode>
<tswipe>2006-09-29T16:09:01</tswipe>
<acid>1</acid>
<author>AYOUNG</author>
<tsig>2006-09-29T16:09:25</tsig>
<cid>667</cid>
<trid>852</trid>
</tube>
<tube>
<pid>100034797</pid>
<barcode>0030000054677</barcode>
<tswipe>2006-09-29T16:08:51</tswipe>
<acid>1</acid>
<author>AYOUNG</author>
<tsig>2006-09-29T16:09:25</tsig>
<cid>667</cid>
<trid>852</trid>
</tube>
<tube>
<pid>122061111</pid>
<barcode>0010000583212</barcode>
<tswipe>2007-01-30T12:11:45</tswipe>
<acid>90003</acid>
<author>AYOUNG</author>
<tsig>2007-01-30T12:12:49</tsig>
<cid>743510</cid>
<trid>896</trid>
</tube>
<tube>
<pid>122061111</pid>
<barcode>0040000017486</barcode>
<tswipe>2007-01-30T12:11:52</tswipe>
<acid>90003</acid>
<author>AYOUNG</author>
<tsig>2007-01-30T12:12:49</tsig>
<cid>743510</cid>
<trid>896</trid>
</tube>
<tube>
<pid>122061111</pid>
<barcode>0050000008394</barcode>
<tswipe>2007-01-30T12:11:36</tswipe>
<acid>90003</acid>
<author>AYOUNG</author>
<tsig>2007-01-30T12:12:49</tsig>
<cid>743510</cid>
<trid>896</trid>
</tube>
<tube>
<pid>122061111</pid>
<barcode>0070000012464</barcode>
<tswipe>2007-01-30T12:12:15</tswipe>
<acid>90003</acid>
<author>AYOUNG</author>
<tsig>2007-01-30T12:12:49</tsig>
<cid>743510</cid>
<trid>896</trid>
</tube>
<tube>
<pid>122061111</pid>
<barcode>0030000098011</barcode>
<tswipe>2007-01-30T12:12:08</tswipe>
<acid>90003</acid>
<author>AYOUNG</author>
<tsig>2007-01-30T12:12:49</tsig>
<cid>743510</cid>
<trid>896</trid>
</tube>
<tube>
<pid>122061111</pid>
<barcode>0061231231230</barcode>
<tswipe>2007-01-30T16:17:01</tswipe>
<acid>90003</acid>
<author>AYOUNG</author>
<tsig>2007-01-30T16:17:41</tsig>
<cid>743510</cid>
<trid>912</trid>
</tube>
</ace_samples>

What I need to do is to group the elements together based on <pid> value and containing all the associated <barcode> values e.g.

<ace_samples source="dispatch" toutput="2007-02-01T13:10:28">
<tube>
<pid>100034797</pid>
<barcode>0030000054677</barcode>
<barcode>0070000013256</barcode>
<barcode>0050000008354</barcode>
<barcode>0040000017080</barcode>
<barcode>0010000581614</barcode>
</tube>
<tube>
<pid>122061111</pid>
<barcode>0061231231230</barcode>
<barcode>0030000098011</barcode>
<barcode>0070000012464</barcode>
<barcode>0050000008394</barcode>
<barcode>0040000017486</barcode>
<barcode>0010000583212</barcode>
</tube>
</ace_samples>

Can anyone point me in the right direction ?

Thanks in advance

Angus
 
Angus,

Yes, the Muench method is also described and illustrated here, in several threads, one as recent last last week:
thread426-1332802
thread426-1210886

Happy to help the newbies that help themselves! :-D

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top