Skip to Content
0
Former Member
Nov 23, 2005 at 01:46 PM

splitting file depends upon no of occurence of element

17 Views

Hi

I have the scenario as follows where i need to split the file depends upon number of occurences of element e1 .

I have input xml file having structure as follows:

<ROOT>

<root1 attribute>

<field1> </field1>

<e1>

<field2> ....</field2>

</e1>

<e1>

<field2> .......</field2>

</e1>

</root1>

<ROOT>

  1. <u>element e1 has "1 to unbounded" occurence.</u>

I would like to have output file structure as

<ROOT>

<root1 attribute>

<field1> </field1>

<e1>

<field2> ....</field2>

</e1>

</root1>

<ROOT>

the key thing for every occcurence of element e1, the output file will be generated and

attribue value of root1 and element position will be included in the file name .

Thanking you in adbvance.

Regards

Piyush