>>>Looks like you got there. Could maybe have made more use of the .NET Xml namespaces or Linq to Xml tho.
>>>The most 'elegant' way would probably be a XLST transform - but you could spend a month learning the ins and outs that :-{
>>>Also interesting to note the performance differences between the .NET and VFP implementations :-}
>>
>>I really dislike .NET documentation. Why do I need to go through 10+ pages to not see one clear full example? Say, I got the answer in my thread
>>
>>
http://social.msdn.microsoft.com/Forums/en-US/xmlandnetfx/thread/a1d05853-53da-43da-80ff-4b64a3c6919a>>
>>and I want to try it but it throws two errors. So, I presume I am missing a reference. But I do not know which one. I checked a few links in MSDN and none tells which using I need.
>>
>>Well, that's strange.
>>
>>This is MSDN sample
>>
>>
>>IEnumerable<XElement> partNos =
>> from item in purchaseOrder.Descendants("Item")
>> where (int) item.Element("Quantity") *
>> (decimal) item.Element("USPrice") > 100
>> orderby (string)item.Element("PartNumber")
>> select item;
>>
>>and this is what I am trying
>>
>>
>>XDocument doc = XDocument.Parse(input);
>>
>> var nodes = doc.Element(rootNode).Descendants()
>> .Where(n => n.Value != "0" && n.Value != ".00" && n.Value != "false" && n.Value != "")
>> .Select(n => new { n.Name, n.Value, Count = n.Ancestors().Count() - 1, n.HasElements });
>>
>>
>>and I do not see why the second throws error about where not implemented?
>
>using System.Linq ; ?
:) Well, it is now compiled! Stupid me! I did have System.Xml.Linq.
If it's not broken, fix it until it is.
My Blog