Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with the recursion logic
Message
From
06/03/2013 10:36:31
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01567554
Message ID:
01567615
Views:
23
>>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 ; ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform