|
I have a xml file in which there is data from multiple tables.
The file looks like --
test.xml
<code>
<Activities>
<ACTIVITY_ID>2</ACTIVITY_ID>
<CREATED_DT>2004-08-24T10:46:53.917</CREATED_DT>
<CREATED_BY>X</CREATED_DT>
</Activities>
<Activities>
<ACTIVITY_ID>3</ACTIVITY_ID>
<CREATED_DT>2004-08-24T10:46:53.917</CREATED_DT>
<CREATED_BY>X</CREATED_DT>
</Activities>
<Contact>
<Name>V1</Name>
<Phone>513-333-3333</Phone>
</Contact>
<Contact>
<Name>V2</Name>
<Phone>513-555-4444</Phone>
</Contact>
<Contact>
<Name>V3</Name>
<Phone>513-666-6666</Phone>
</Contact>
</code>
I want to make two file from this
Activities.xml and second Contact.xml
Activities.xml will have
<code>
<Activities>
<ACTIVITY_ID>2</ACTIVITY_ID>
<CREATED_DT>2004-08-24T10:46:53.917</CREATED_DT>
<CREATED_BY>X</CREATED_DT>
</Activities>
<Activities>
<ACTIVITY_ID>3</ACTIVITY_ID>
<CREATED_DT>2004-08-24T10:46:53.917</CREATED_DT>
<CREATED_BY>X</CREATED_DT>
</Activities>
</code>
And Contact.xml will have
<code>
<Contact>
<Name>V1</Name>
<Phone>513-333-3333</Phone>
</Contact>
<Contact>
<Name>V2</Name>
<Phone>513-555-4444</Phone>
</Contact>
<Contact>
<Name>V3</Name>
<Phone>513-666-6666</Phone>
</Contact>
</code>
The number of rows in each table will vary. Also there are more than two tables , so tags like Activity and Contact can be many, each one having many rows.
I need to create sepearte file for each of these main tags.
Please help
Thanks!
Leo
|