Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » LINQ   (RSS)
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 Read More...
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 Read More...
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 Read More...
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 Read More...
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, Read More...
Comparing Two Open XML Documents using the Zip Extension Method
[BlogMap] (Note: this is a post on comparing two Open XML word processing documents. For a post on comparing two XML documents, see Equality Semantics of LINQ to XML Trees .) Sometimes we want to compare two word processing documents to see if they contain Read More...
Querying LINQ to XML Nodes in Reverse Document Order with Better Performance
[Blog Map] (Update June 25, 2009 - fixed bugs in event handlers associated with deleting last node and inserting node at beginning of list) Occasionally I need to query LINQ to XML nodes in reverse document order. I’m currently writing some LINQ to XML Read More...
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 Read More...
Comparison of LINQ to XM and the Open XML SDK Strongly Typed OM
LINQ to XML code is highlighted in yellow . Open XML SDK strongly typed object model is highlighted in green . using System; using System.IO; using System.Linq; using System.Xml; using System.Xml.Linq; using DocumentFormat.OpenXml.Packaging; using DocumentFormat.OpenXml.Wordprocessing; Read More...
Comparison of Navigating Parts between System.IO.Packaging and the Open XML SDK
Code highlighted in yellow shows navigating from the package to the main document part. Code highlighted in green shows navigating from the main document part to the styles part. using System; using System.Linq; using System.IO; using System.IO.Packaging; Read More...
LINQ / Open XML at TechEd 2009
I’ll be presenting a talk on LINQ and Open XML at TechEd 2009. The session is “OFC403 Developing Office Client Solutions Using LINQ and Open XML”. I’ll be presenting on Thursday, 5/14, at 4:30PM in Room 411. Here is the abstract for the talk: In this Read More...
The Use of Extension Methods to Manage Open XML Document Changes in PowerTools for Open XML
There is an interesting approach that we use in PowerTools for Open XML that makes it easy to write cmdlets that modify Open XML documents. This approach isn’t very complicated, but aspects of this approach need some explanation so that developers who Read More...
Using DocumentBuilder with Content Controls for Document Assembly
DocumentBuilder is an example class that’s part of the PowerTools for Open XML project that enables you to assemble new documents from existing documents. One of the problems to solve when moving markup from one document to another is that of interrelated Read More...
Why I Don’t Use the ForEach Extension Method
In my first version of my functional programming tutorial , I discussed a ForEach extension method, but I removed the topic from the second version. This extension method iterates through a source collection and performs an action on each item in the Read More...
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 Read More...
More Posts Next page »
Page view tracker