DotNetNewbie <sn***********@yahoo.comwrote:
My XML looks like this:
<cars>
<mfg name="honda">
<car name="accord" />
<car name="civic" />
</mfg>
<mfg name="ford">
<car name="escort" />
<car name="taurus" />
</mfg>
</cars>
I want to get ONLY the cars for a specific mfg. example: get me all
the car nodes that are ford's.
What is the most effecient way of doing this?
Do you really need the most *efficient* way of doing this rather than,
say, the most readable or maintainable? How big is your file going to
be in real life? Is it actually a file, or do you already have it in
memory?
Personally, I'd use LINQ to XML if .NET 3.5 is an option.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
World class .NET training in the UK:
http://iterativetraining.co.uk