Browse by Tags

All Tags » Useful Code Snippets
Showing page 1 of 4 (33 total posts)
  • Table Markup in Open XML SpreadsheetML

    Tables are a feature in Open XML spreadsheets that allow you to interact with data more like a database.  You can select a region and convert it to a table.  Most Excel aficionados are familiar with this feature.  It is very useful.   In a previous post, Using LINQ to Query Excel Tables, I presented some code that allows you ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on July 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
  • Merging Comments from Multiple Open XML Documents into a Single Document

    Microsoft Word 2007 allows you to lock a document, prohibiting users from making changes to content, while allowing them to add comments.  If we have multiple documents that have the same content yet different comments, we can merge those comments into a single document.  One possible use would be a specification review ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on July 27, 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
  • 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
  • Comparing Two Open XML Documents using the Zip Extension Method

    [BlogMap] Sometimes we want to compare two word processing documents to see if they contain the same content.  I’m working on a blog post to merge comments from multiple Open XML documents into a single document.  This is based on a feature in Word 2007 that allows you to lock a document and prevent changes to content, yet allows users ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on July 5, 2009
  • Querying LINQ to XML Nodes in Reverse Document Order with Better Performance

    Occasionally I need to query LINQ to XML nodes in reverse document order.  I’m currently writing some LINQ to XML queries over Open XML documents where I need to select paragraph nodes based on content in the immediately preceding paragraph.  However, nodes in LINQ to XML are forward-linked only.  We can see evidence of this in the ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on June 24, 2009
  • Creating a Template Open XML Document in Memory

    One of the most effective ways to generate Open XML documents, spreadsheets, or presentations is to start with a ‘template’ document and then modify the document.  For instance, you can start with a blank word processing document that is set up with your desired styles, and then add paragraphs and tables as necessary.  Or you can start ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on February 28, 2009
  • Ease of Maintenance of LINQ Code (2)

    [Blog Map] In two previous posts, I developed a somewhat involved query to search through a word processing document for style names and/or paragraph content.  This is a query that I’m developing for the PowerTools for Open XML project.  In those posts, as I evolved the query, I showed each iteration of it, highlighting the changes I ...
    Posted to LINQ in Action roller (Weblog) by Anonymous on February 22, 2009
1 2 3 4 Next >