I have this hierarchy of XML
<Chapters>
<Chapter @num="">
<Section @letter="">
<Heading @num="" />
</Section>
</Chapter>
</Chapters>
I need to do a sort so that all chapters are sequenced in ascending order, each section within that chapter is sequenced in ascending order, and each heading in that section is sorted...
Doing the following yields the Chapters sorted properly, but obivously the child data isn't sorted:
Dim chapsorted = From c In root.Elements
Order By c.@num Ascending
Select c
From there I'm lost. I tried this crazy thing to get the full results I want, but that didn't do me any good either:
Dim chapsorted = From c In root.Elements
Order By c.@num Ascending
Select (From sec In c.Elements Order By sec.@letter Where sec.Parent Is c Select
(From hed In sec.Elements Order By hed.@num Where hed.Parent Is sec)))
That did me no good either.
There has got to be a simple way of doing this.... :-) Help will be greatly appreciate, I've been spinning my wheels for hours.