xsl-list
[Top] [All Lists]

[xsl] Split one line to multiple lines

2014-10-09 14:59:14



I want to split the values in "Product" to multiple lines. For eg: for LineId = 
222, there are 3 values (BBB;CCC;DDD;). So I need to create 3 lines along with 
the first line. How can I do that?
Eg: 
<ns1:Lines>
<ns1:Line>
<ns1:LineId>111</ns1:LineId>
<ns1:Product>AA</ns1:Product>
<ns1:Amount>100</ns1:Amount>
</ns1:Line>
<ns1:Line>
<ns1:LineId>222</ns1:LineId>
<ns1:Product>BBB;CCC;DDD;</ns1:Product>
<ns1:Amount>200</ns1:Amount>
</ns1:Line>
</ns1:Lines>

Output
<ns1:Lines>
<ns1:Line>
<ns1:LineId>111</ns1:LineId>
<ns1:Product>AAA</ns1:Product>
<ns1:Amount>100</ns1:Amount>
</ns1:Line>
<ns1:Line>
<ns1:LineId>222</ns1:LineId>
<ns1:Product>BBB</ns1:Product>
<ns1:Amount>100</ns1:Amount>
</ns1:Line>
<ns1:Line>
<ns1:LineId>222</ns1:LineId>
<ns1:Product>CCC</ns1:Product>
<ns1:Amount>100</ns1:Amount>
</ns1:Line>
<ns1:Line>
<ns1:LineId>222</ns1:LineId>
<ns1:Product>DDD</ns1:Product>
<ns1:Amount>100</ns1:Amount>
</ns1:Line>
</ns1:Lines>

I know there is a tokenize function. But how do I copy other values?

Thank you.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>