Browse by Tags

All Tags » LINQ » xml
Showing page 1 of 2 (19 total posts)
  • Convert XDocument to XmlDocument (and Convert XmlDocument to XDocument)

    Some time ago, I blogged about an approach for converting an XElement object to an XmlNode object, and vice versa.  This is useful when you want to use a programming interface that takes and returns objects of type XmlNode, but you want to use the expressiveness and power of LINQ to XML for your code that modifies the XML tree.  There ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on March 5, 2010
  • Writing Entity References using LINQ to XML

    I need to write out some XHtml, and in several places, I want that XHtml to contain entities references.  However, you can't simply write the entitle reference like this: XElement p = new XElement(''p'', ''  Hello''); Console.WriteLine(p);   LINQ to XML will replace the ampersands with its ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on January 21, 2010
  • DescendantsAndSelfTrimmed LINQ to XML Axis Method

    [Blog Map] There are some circumstances where I need a variation on the DescendantsAndSelf axis method that allows me to specify that specific elements (and the descendants of those elements) are ‘trimmed’ from the returned collection.  One of the things that's great about LINQ to XML is the ease with which we can create specialized axis ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on August 19, 2009
  • Recursive Approach to Pure Functional Transformations of XML

    [Blog Map] Writing pure functional transformations a in a recursive style enables us to put together interesting transformations in a very small amount of code.  Using some specific techniques that allow us to write this code very concisely, this approach takes advantage of some perhaps obscure semantics of LINQ to XML.  I’ve used ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on July 20, 2009
  • A Tutorial in the Recursive Approach to Pure Functional Transformations of XML

    [Blog Map] Writing pure functional transformations a in a recursive style enables us to put together interesting transformations in a very small amount of code.  Using some specific techniques that allow us to write this code very concisely, this approach takes advantage of some perhaps obscure semantics of LINQ to XML.  I’ve used ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on July 20, 2009
  • Visual Studio Magazine Article Retrospective

    Following are images of Visual Studio Magazine issues from late 2003 to the present for which I've written cover stories. Each entry includes the article name and deck. Click the image to open the article from the Visual Studio Magazine Web site. Updated 6/28/2008: As of early 2008, archives of articles earlier than October 2006 are no longer ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on July 17, 2009
  • Document-Centric Transforms using LINQ to XML

    [Blog Map] When thought of in a certain way, XML documents come in two flavors – data-centric and document-centric.  Further, there are two types of document-centric documents.  This post presents my thoughts about approaches to various types of document-centric transformations – data-centric to document-centric, document-centric to ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on July 9, 2009
  • Empty Elements and Self-Closing Tags

    Last January, I blogged about an approach to normalizing LINQ to XML trees.  That post is based on another post, Manually Cloning LINQ to XML Trees.  In those posts, my code to clone an element would clone a self-closing element (<Tag/>) as self-closing, and an empty element with a start and end tag (<Tag></Tag>) as an ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on July 7, 2009
  • Working with Optional Elements and Attributes in LINQ to XML Queries

    Often XML schemas allow for optional elements and attributes.  When you write queries on these elements or attributes, you may be tempted to write code that does lots of testing for null.  There is a better way to do this, laid out in this post.  I covered this idiom in a previous post, but the main purpose of that post wasn’t to ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on May 13, 2009
  • Computing Deep Hash Codes using LINQ to XML

    In some scenarios, it is useful to compute a ‘deep’ hash code using LINQ to XML.  If you are writing a server-side application that caches queries expressed in XML, then you may want to store these queries in a hash table.  XNode (and XElement) inherit the GetHashCode method from object, which returns a hash code based on object ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on February 21, 2009
1 2 Next >