Browse by Tags
All Tags »
XML (RSS)
[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...
[Blog Map] Some time ago, a dev team here at Microsoft asked me to review their XML vocabulary that they had designed. They wanted to know if the element and attribute names in their vocabulary design were good ones. Note: I suspect that this is one of
Read More...
[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...
[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...
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...
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...
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
Read More...
[Blog Map] (July 1, 2009 - Updated - OK to normalize empty elements to an element with a self-closing tag.) There are a variety of circumstances where you want to clone a LINQ to XML tree while making modifications to the cloned tree. It’s possible to
Read More...
At TechReady8, I’ll be presenting a 400 level course “Developing Office Client Solutions using LINQ and Open XML”. TechReady8 is a Microsoft employee only event, but non-Microsoft folks in the Seattle area can come see the same talk at the .NET Developers
Read More...
[Blog Map] Web services are one of the most effective and convenient ways for casual developers to access SharePoint lists and document libraries. They have a reputation for being a bit difficult; LINQ to XML can make them easier to use. This post presents
Read More...
[Blog Map] There is an interesting idiom of LINQ to XML that makes it easy to write short, succinct code when creating one XML tree from another. Many folks are not aware of this idiom, but it is a useful and convenient trick. I documented this idiom
Read More...
[Blog Map] Sometimes an XML element contains a large number of attributes, and the values of the attributes may be long. When written to the console, such lines wrap, making it hard to read the XML. In particular, the XML responses from SharePoint web
Read More...
[Blog Map] Sometimes you want to convert an XmlNode to an XElement and back again. Some programming libraries define methods that take XmlNode objects as parameters. These libraries also may contain properties and methods that return XmlNode objects.
Read More...
There is an approach using LINQ to XML that provides some of the benefits of a strongly typed document object model. The approach consists of declaring a static class with static, initialized XName and XNamespace fields in the class, and then using those XName and XNamespace objects in the LINQ to XML code that creates and queries XML trees.
Read More...
[Blog Map] Debugging LINQ queries can be problematic. One of the reasons is that quite often, you write a large query as a single expression, and you can’t set a breakpoint mid-expression. Writing large queries in expression context is particularly powerful
Read More...