Rank: Newbie
Joined: 11/12/2018 Posts: 2 Location: Weert
|
Hi,
I want to generate an XSLT that transforms XML 1 (zie attachment) to XML 2.
Grouping on invoice needs to be done when FIELD1=0, that's where the lines for a new invoice start. All lines up untill the next FIELD1=0 are 1 invoice. The sample XML contains 2 invoices. How do I group this?
Shortened example:
<items> <item> <FIELD1>0</FIELD1> </item> <item> <FIELD1>1</FIELD1 </item> <item> <FIELD1>2</FIELD1 </item>
<item> <FIELD1>0</FIELD1> </item> <item> <FIELD1>1</FIELD1 </item> <item> <FIELD1>2</FIELD1 </item> and so on.. <items>
has to transform to:
<items> <INVOICE> <item> <FIELD1>0</FIELD1> </item> <item> <FIELD1>1</FIELD1 </item> <item> <FIELD1>2</FIELD1 </item> </INVOICE>
<INVOICE> <item> <FIELD1>0</FIELD1> </item> <item> <FIELD1>1</FIELD1 </item> <item> <FIELD1>2</FIELD1 </item> </INVOICE>
<items>File Attachment(s): 2.xml (55kb) downloaded 335 time(s). 1.xml (55kb) downloaded 320 time(s).
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
Try using the "group-starting-with" function
island attached the following image(s):
|
Rank: Newbie
Joined: 11/12/2018 Posts: 2 Location: Weert
|
Thnx, that did the trick!
|