on 05-17-2013 1:00 PM
Hi All,
I have a specific requirement where I have to repeat a target segment with respect to the integer value of a source element.
Source Structure
<Ticket Print>
--> Store(0..1)
-->TicketSize(0..1)
--> Item(0..n)
------>Header(0..1)
------>Counter(0..1)
------->StartDate(0..1)
-------->TicketQty(0..1)
Target Structure is also same
But I have to repeat Item node with respect to ticket quantity.
Source XML
<Ticket Print>
<Store>23<Store>
<TicketSize>2</TicketSize>
<Item>
----><Header>A</Header>
----><Counter>1</Counter>
----><StartDate>20130517</StartDate>
----><TicketQty>2</TicketQty>
<Item>
----><Header>B</Header>
----><Counter>2</Counter>
----><StartDate>20130517</StartDate>
----><TicketQty>1</TicketQty>
TargetXML
<Ticket Print>
<Store>23<Store>
<TicketSize>2</TicketSize>
<Item>
----><Header>A</Header>
----><Counter>1</Counter>
----><StartDate>20130517</StartDate>
----><TicketQty>1</TicketQty>
<Item>
----><Header>A</Header>
----><Counter>1</Counter>
----><StartDate>20130517</StartDate>
----><TicketQty>1</TicketQty>
<Item>
----><Header>B</Header>
----><Counter>2</Counter>
----><StartDate>20130517</StartDate>
----><TicketQty>1</TicketQty>
So the Item node shud repeat as per the value of ticket qty in source.
Ticket qty will have only value 1 in XML.
Can you please suggest any idea on how to proceed.
Regards,
Malini
hi
pass this TicketQty to below udf.
for(int i=0;i<ticketQty;i++)
{
result.addvalue("");
}
ticketQtry-->UDF-->ItemNode
if ticketQty not coming sometimes try with exists and createif functionality
Regards,
Loordh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.