I have a document like so (Its actually a serilization of an Object)
<Person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BirthDate>8/31/1971</BirthDate>
<CurrentEmployer>NSA</CurrentEmployer>
<Kids>
<Person>
<BirthDate>8/31/1981</BirthDate>
<CurrentEmployer>NSA</CurrentEmployer>
<EducationLevel>Drop Out</EducationLevel>
<Gender>Male</Gender>
<MaritalStatus>Single</MaritalStatus>
<NumberOfDependentAdults>0</NumberOfDependentAdults>
<NumberOfDependentChildren>1</NumberOfDependentChildren>
</Person>
<Person>
<BirthDate>8/3/1991</BirthDate>
<CurrentEmployer>NSA</CurrentEmployer>
<EducationLevel>Drop Out</EducationLevel>
<Gender>Male</Gender>
<MaritalStatus>Single</MaritalStatus>
<NumberOfDependentAdults>0</NumberOfDependentAdults>
<NumberOfDependentChildren>0</NumberOfDependentChildren>
</Person>
</Kids>
<EducationLevel>PHD.</EducationLevel>
<Gender>Male</Gender>
<MaritalStatus>Married</MaritalStatus>
<NumberOfDependentAdults>1</NumberOfDependentAdults>
<NumberOfDependentChildren>4</NumberOfDependentChildren>
<PersonName>
<FirstName>Uknow</FirstName>
<LastName>Who</LastName>
<PrefixTitle>Mr.</PrefixTitle>
</PersonName>
</Person>
What is the most efficient way to break this into the following
fragments
People (3 of em , 1 for the root and 1 for each child)
So I have the following
<Person>
<BirthDate>8/31/1971</BirthDate>
<CurrentEmployer>NSA</CurrentEmployer>
<EducationLevel>PHD.</EducationLevel>
<Gender>Male</Gender>
<MaritalStatus>Married</MaritalStatus>
<NumberOfDependentAdults>1</NumberOfDependentAdults>
<NumberOfDependentChildren>4</NumberOfDependentChildren>
</Person>
<Person>
<BirthDate>8/31/1981</BirthDate>
<CurrentEmployer>NSA</CurrentEmployer>
<EducationLevel>Drop Out</EducationLevel>
<Gender>Male</Gender>
<MaritalStatus>Single</MaritalStatus>
<NumberOfDependentAdults>0</NumberOfDependentAdults>
<NumberOfDependentChildren>1</NumberOfDependentChildren>
</Person>
<Person>
<BirthDate>8/3/1991</BirthDate>
<CurrentEmployer>NSA</CurrentEmployer>
<EducationLevel>Drop Out</EducationLevel>
<Gender>Male</Gender>
<MaritalStatus>Single</MaritalStatus>
<NumberOfDependentAdults>0</NumberOfDependentAdults>
<NumberOfDependentChildren>0</NumberOfDependentChildren>
</Person>
PersonName (1 the one belonging to the base person)
<PersonName>
<FirstName>Uknow</FirstName>
<LastName>Who</LastName>
<PrefixTitle>Mr.</PrefixTitle>
</PersonName>
I dont need any refrences , I already know those, I just need the
fragments.
What is the easiest (And MOST efficient way) of chunking it out ?
Some kind of Recursive function ?
BUT I cant seem to figure out how to get the XPath navigator doing what
I need it to.(And is that efficient)
Its possible to have hirearchies say 20 deep with 30-40 nodes so
efficieny is of the utmost.
Some direction from any xml gods would be much appreciated.
Thanks
Chris