Browse by Tags

All Tags » LINQ and LINQ to XML
Showing page 1 of 2 (14 total posts)
  • New Version of Functional Programming Tutorial

    Some time ago, I was talking to some members of a team that used LINQ and LINQ to XML in one particular area of their code.  They said that the code written using a conventional approach to XML was in the order of 6000 lines of code.  When re-written using LINQ and LINQ to XML, it was around 800 lines of code.  It was faster to ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on April 23, 2008
  • The GroupAdjacent Extension Method

    This is a bit of a geeky post for the LINQ and LINQ to XML folks.  This post introduces a GroupAdjacent generic extension method that groups elements in a collection with adjacent elements based on a common key.  For example, grouping the following array creates six groups (not 3, as with GroupBy):  int[] ia = new int[] { 1, 0, 0, ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on April 20, 2008
  • Performance of LINQ to XML

    It can be problematic for us here at Microsoft to make specific performance claims of one technology to another, for example, comparing the performance of XmlDocument, say, to LINQ to XML. A good programmer can write code in any number of technologies...(read more)
    Posted to LINQ in Action roller (Weblog) by Anonymous on December 6, 2007
  • More thoughts on LINQ to XML transformations that use annotations

    I've received some comments indicating that XSLT is better for these types of transformations. FWIW, I absolutely agree about the usage scenarios for XSLT. In the LINQ to XML documentation, I have at least 4 or 5 examples that show how to use XSLT to transform an XML tree. XSLT transforms create a new tree, so XSLT does not aleviate the ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on August 9, 2007
  • How to: Use Annotations to Transform LINQ to XML Trees in an XSLT Style

    Introduction Annotations can be used to facilitate transforms of an XML tree. Some XML documents are ''document centric with mixed content.'' With such documents, you don't necessarily know the shape of child nodes of an element. For instance, a node that contains text may look like this: [xml] <text>A phrase with ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on July 29, 2007
  • Streaming From Text Files to XML

    Quite some time ago, I wrote a blog post on how you can stream text files as input into LINQ queries by writing an extension method that yields lines using the yield return statement. You then can write a LINQ query that processes the text file in a lazy deferred fashion. If you then use the T:System.Xml.Linq.XStreamingElement to stream ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on May 20, 2007
  • LINQ to XML: Implementing the Visitor Pattern using Extension Methods

    We often use the Visitor pattern to separate the structure of an object tree or collection from the operations performed on that tree or collection. There are lots of ways in LINQ where you can visit some function on a collection, but when implementing this pattern as a couple of extension methods in LINQ to XML, we can pass the element depth as ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on September 23, 2006
  • Fun with Anonymous Types and LINQ to XML

    You can, of course, use C# anonymous types to create types that are more than simple tuples. For example, you can nest anonymous types to create an object graph: var PurchaseOrder = new {    PurchaseOrderNumber = ''99503'',    OrderDate = DateTime.Parse(''1999-10-20''),    Addresses = new [] ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on September 16, 2006
  • More Notes on LINQ to Text Files

    Following are a few additional notes regarding the Linq to Text Files example. Taking Advantage of Multiple CPUs If you have some type of computing where you need to process large text files, and the processing of the text files is processor intensive, the possibility exists in the future where you could factor your ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on September 16, 2006
  • LINQ to Text Files

    Lazy evaluation is an important technique in functional programming. There is a entertaining article on functional programming here. I was thinking about lazy evaluation the other day, and the issues of processing huge text files using streaming techniques, and I realized that LINQ could do really cool things if I implemented an ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on August 31, 2006
1 2 Next >