I have a bunch of records going into the XML writer to be written as XML messages. So far this is what I have (note that personOID can be used as a key):
<Person_List>
<lastModifiedDTM></lastModifiedDTM>
<createDTM></createDTM>
<recordStatus>Active</recordStatus>
<personOID>5</personOID>
<lastName>Aman</lastName>
<firstName>Hussain</firstName>
<professionalOID></professionalOID>
<upin>789</upin>
<npi>HU997</npi>
<tin></tin>
</Person_List>
What I need to achieve is this XML message to be split into seperate tags:
<Person_List>
<Person>
<lastModifiedDTM></lastModifiedDTM>
<createDTM></createDTM>
<recordStatus>Active</recordStatus>
<personOID>5</personOID>
<lastName>Aman</lastName>
<firstName>Hussain</firstName>
<Person>
</Person_List>
<Professional_List>
<Professional>
<lastModifiedDTM></lastModifiedDTM>
<createDTM></createDTM>
<recordStatus>Active</recordStatus>
<personOID>5</personOID>
<professionalOID></professionalOID>
<upin>789</upin>
<npi>HU997</npi>
<tin></tin>
</Professional>
</Professional_List>
I tried the below sample mapping from the Clover Wiki but apparently did not get the required format:
http://wiki.cloveretl.org/doku.php?id=c ... #xmlwriter
<Mapping>
<Mapping>
...
</Mapping>
...
</Mapping>
Thanks,
- CB
<Person_List>
<lastModifiedDTM></lastModifiedDTM>
<createDTM></createDTM>
<recordStatus>Active</recordStatus>
<personOID>5</personOID>
<lastName>Aman</lastName>
<firstName>Hussain</firstName>
<professionalOID></professionalOID>
<upin>789</upin>
<npi>HU997</npi>
<tin></tin>
</Person_List>
What I need to achieve is this XML message to be split into seperate tags:
<Person_List>
<Person>
<lastModifiedDTM></lastModifiedDTM>
<createDTM></createDTM>
<recordStatus>Active</recordStatus>
<personOID>5</personOID>
<lastName>Aman</lastName>
<firstName>Hussain</firstName>
<Person>
</Person_List>
<Professional_List>
<Professional>
<lastModifiedDTM></lastModifiedDTM>
<createDTM></createDTM>
<recordStatus>Active</recordStatus>
<personOID>5</personOID>
<professionalOID></professionalOID>
<upin>789</upin>
<npi>HU997</npi>
<tin></tin>
</Professional>
</Professional_List>
I tried the below sample mapping from the Clover Wiki but apparently did not get the required format:
http://wiki.cloveretl.org/doku.php?id=c ... #xmlwriter
<Mapping>
<Mapping>
...
</Mapping>
...
</Mapping>
Thanks,
- CB
-
Quick correction: for each tag (first tag (Person_List) shown below), how would I have it in the below format?
<Person_List><Person></Person></Person_List>
Thanks,
- CB -
Hi,
there may be just one root element.
Person_List or Professional_List, not both of them.
You should get this result <Person_List><Person>...</Person> ... </Person_List>
with this configuration:
<Node id="XML_OUT"
type="XML_WRITER"
rootElement="Person_List"
... >
<attr name="mapping"><![CDATA[
<Mapping
inPort="0"
element="Person"
fieldsAs="elements" >
</Mapping>
]]></attr>
</Node>
To specify relation between Person and Professional, add mapping subelement, i.e.
<Mapping
inPort="1"
element="Professional"
parentKey="personOID"
key="personOID"
fieldsAs="elements"
/>
I believe, this will help you.
Regards,
Martin Varecha
Please sign in to leave a comment.
Comments 2