I am trying to get the data from input xml message using functoids. But this doesn’t seem to work. Below is my XML snippet
<?xml version="1.0" ?>
<ROOT>
<COMPANIES>
<COMPANY>
<NAME>FOO CORP</name>
</COMPANY>
<COMPANY>
<NAME>ACME CORP</name>
</COMPANY>
</COMPANIES>
<INFORMATIONS>
<INFORMATION>
<TESTING>
<TESTS>
<NAME>1221</NAME>
<TEST>
<TEXT>I AM SAM</TEXT>
</TEST>
</TESTS>
<TESTS>
<NAME>21</NAME>
<TEST>
<TEXT>FADFDF</TEXT>
</TEST>
</TESTS>
<TESTS>
<NAME>3001</NAME>
<TEST>
<TEXT>SGFGSDFG</TEXT>
</TEST>
</TESTS>
<TESTS>
<NAME>4569</NAME>
<TEST>
<TEXT>12312</TEXT>
</TEST>
</TESTS>
</TESTING>
<INFORMATION>
</INFORMATIONS>
</ROOT>
-
First I am trying to loop through COMPANY and get the NAME “ACME CORP”. but which ever functoid i use (scripting, string extract etc) I always get the FOO CORP. I even tried inline XSLT but that also doesn’t seem to work. Any idea how to get the 2nd COMPANY name?
-
Secondly, I have mapped
<TEXT>directly to<node>in my destination schema. What i get is only 2 values from<TEXT>. Not all the<TEXT>are mapped to my<node>. Output i am getting is
I don’t get isI AM SAM
FADFDF
I don’t get
<node>SGFGSDFG</node>
<node>12312</node>
Any one knows how i could get the values?
Thanks in advance
cheers,
Karthik
Q1: How to get the
NAMEof the secondCOMPANY?1) Add Iteration functoid (Advanced Functoids) and connect to
COMPANYnode in your source schema2) Add Equal functiod (Logical Functoids) and connect to Iteration functoid
3) Configure Equal functoid; add constant value
24) Add Value Mapping (Flattening) functoid (Advanced Functoids)
5) Connect output of Equal to input of Value Mapping
6) Connect
NAMEemlement of source schema to input of Value Mapping7) Connect output of Value Mapping to destination schema element
Q2: Not all source
TEXTelements are transformed to destinationnodeThis seems to be a side effect of your mapping concering Q1 and I cannot reproduce your error.
Check minOccurs and maxOccurs of your source and destination schema for the elements/nodes in question.