Springboard Pillow
Paddling in the murky bits of the byte stream
Showing posts with label
linq2xml
.
Show all posts
Showing posts with label
linq2xml
.
Show all posts
Friday, June 18, 2010
Calculate XML Element Depth
In XPath (from the excellent D.Pawson site):
select="count(ancestor::*)"
http://www.dpawson.co.uk/xsl/sect2/N2193.html
In LINQ:
int depth = element.Ancestors().Count();
Friday, February 05, 2010
Learning More About Linq To Xml
Being armpit-deep in the slightly clearer .NET waters of MVC 2 RC 2 has lead me to getting further into the (shark infested?) LINQ deeps. Therefore, when I went looking for some good "how to sort XML using LINQ" on google, I came across this:
C# LINQ2XML examples:
http://msdn.microsoft.com/en-us/vcsharp/bb688087.aspx
In the URL, replace
vcsharp
with
vbasic
to get the Visual Basic version.
From the MSDN dev centre:
http://msdn.microsoft.com/en-us/default.aspx
Answered my problems:
http://stackoverflow.com/questions/2208844/how-to-sort-xml-in-linq-c-by-an-attribute-value-also-mvc
And some others:
http://srtsolutions.com/blogs/billwagner/archive/2006/03/29/ordering-linq-results.aspx
Monday, January 25, 2010
LINQ, LINQ2SQL, LINQ2XML. It's linky...
Boning up on LINQ and I'm finding bits all over the place. So, another personal haven of links and hopefully useful info now resides on this post...
http://www.hookedonlinq.com/LINQtoXML5MinuteOverview.ashx
http://msdn.microsoft.com/en-us/vstudio/bb821253.aspx
http://stackoverflow.com/questions/2131061/how-do-i-insert-an-element-into-xml-using-linq
http://www.mssqltips.com/tip.asp?tip=1524
Older Posts
Home
Subscribe to:
Posts (Atom)