all groups > dotnet xml > november 2006 >
You're in the

dotnet xml

group:

Most efficient to Break this up


Most efficient to Break this up cwertman NO[at]SPAM gmail.com
11/22/2006 11:43:40 AM
dotnet xml:
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
Re: Most efficient to Break this up cwertman NO[at]SPAM gmail.com
11/27/2006 1:25:19 PM
Please ..... anyone.... ?

I am tearing what hair I have left out over this.

The problem is with a persistance layer and deep object serilization
and until I get it solved I am dead in the water.

I have some "Hacks" that get me part way there but before completion I
can tell the overhead on large sets will be,,,,, well......ABYSIMAL at
best.


[quoted text, click to view]
AddThis Social Bookmark Button