on 02-02-2006 10:40 AM
Can I get the Number Occurance of a segment
Source MSG
-
Tree Occurence
**File_Message (1..1)
.....Name (1..1)
.....Sal (1..1)
.....**Details (1..Unbound)
.........MailID (1..1)
.........MobileNO (1..1)
Target MSG
**CountDetails (1..1)
.....Count (1..1)
In Target MSG, I want the number of occurance of the FileDeatils-->Details
if source file is like follow
<?xml version="1.0" encoding="UTF-8"?>
<ns0:File_Message xmlns:ns0="urn:test:ns:ns">
<Nam>John</Nam>
<Sal>2342</Sal>
<Details>
<MailID>John@ABB.com</MailID>
<TelNo>345345345</TelNo>
</Details>
<Details>
<MailID>John1@ABB.com</MailID>
<TelNo>888888888</TelNo>
</Details>
</ns0:File_Message>
I need to get the taget Message as follow
<?xml version="1.0" encoding="UTF-8"?>
<ns0:CountDetails xmlns:ns0="urn:test:ns:ns">
<Count>2</Count>
</ns0:CountDetails>
in Count Tag I should get the number of occurance of Details Tag in source MSG
Can any one help regard this
Thanks is advance
Hi,
Write one advanced user defined function which takes DETAILS as the input.
Code:
for (int i=0, i<a.lenght;i++)
{
result.addValue("");
}
Map the output of this user defined function to COUNT(Node Function).
You will get the number of occurances.
Thanks
Mohan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai Mohan,
My Real Problem is
I am Using the Scenario File--> XI --IDoc (Using BPM)
File is having the following value
Header Details (one Occurance)
PO(1..Unbound)
for Example that file having 2 PO (Purchase Order) Then I have to split that file in to two files..
and I have to pass that two files to Post Idoc(0rders02) for create sal Order.
That file may have more than one PO
Please give Ur Suggest me on this
Thanks in advance
Dhanabal T
Chk out standard functions in mapping -> Statistic
and assign the count function [input Details node and output target node count]( Returns = Number of fields in a context and do try changing the context to root level ).
if this doesnt work we can write a user defined function
where pass input node details (details node is a)
and use
return a.length;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.