|
|
Browse by Tags
All Tags » OpenXmlSdk » OpenXML » LINQ to XML (RSS)
-
[Blog Map] One of the advantages of V2 of the Open XML SDK is that it provides us with a strongly typed XML document object model (DOM). Because elements are represented by classes, and attributes are represented by properties in the classes, developers are not at risk of misspelling element and attribute names. I was chatting about the Open XML SDK V2 with a customer, who appreciated the advantages of this approach. However, V2 of the SDK is not an option for them, because it won’t be available Read More...
|
-
When working with Open XML documents from within SharePoint, you may want to open a specific document, modify it in some way, and then save it, either replacing the original document, or saving to a new location. This isn’t very hard, but there are a few issues. This post describes the issues and presents a minimal amount of code that shows how to open an Open XML document from a SharePoint list, modify it, and then save it back to either the same location, or a different one if you desire. In detail, Read More...
|
-
A couple of weeks ago, I posted some code to use LINQ to query tables in an Excel spreadsheet . Because you can query databases using LINQ to SQL, you can write code to query a database and do a join with data in an Excel spreadsheet. This can enable some interesting scenarios – let’s say that you have a database that contains some sort of master records, and you’ve downloaded another table and significantly modified it through one means or another. Without using this technique, you would either Read More...
|
-
I recently posted some code that allows you to use LINQ to query Excel tables . The source for these queries is the Open XML document – you don’t need to involve the Excel application to query the data in these tables. In that post, I presented a few examples of queries of various types. This post shows a join of two tables using the extension methods and classes presented in that post. The source for this query is a spreadsheet where I imported two columns of the Northwind data into two worksheets. Read More...
|
-
[Blog Map] Excel has a very cool feature where you can declare that a range of cells is a table. It is a feature that allows you to use Excel very much like a database. You can add new rows as necessary, sort the table by columns, do some simple filtering, calculate the sum of columns, and more. Each table has a unique table name, and each column has a name unique to its table. Because these tables are stored in Open XML documents, we can implement some simple extension methods and some classes so Read More...
|
-
[Blog Map] A convenient way to explore Open XML markup is to create a small document, modify the document slightly in the Word user interface, save it, and then compare it with the Open XML Diff utility that comes with the Open XML SDK V2 . However, Word adds extraneous elements and attributes that enable merging of two documents that have forked. These elements and attributes show up as changed, and obscure the differences that we’re looking for. An easy way to deal with this is to remove these Read More...
|
-
I’ll be presenting two sessions on the Open XML SDK at Tech Ed 2008 EMEA in Barcelona. OFC206 - Open XML SDK Version 2 Overview and Architecture (November 12, 13:30 - 14:45) In this session, I’ll present an overview of V2 of the Open XML SDK. I’ll talk a bit about the architecture of the Open XML formats. I’ll then compare and contrast the Office object model and the Open XML SDK, and the key benefits from using the SDK. We’ll discuss the architecture of the Open XML SDK, and the roadmap for the Read More...
|
-
[Blog Map] Merging multiple word processing documents into a single document is something that many people want to do. An application built for attorneys might assemble selected standard clauses into a contract. An application built for book publishers can assemble chapters of a book into a single document. This post explains the semantics of the altChunk element, and provides some code using the Open XML SDK that shows how to use altChunk. Instead of using altChunk, you could write a program to Read More...
|
-
Data-bound content controls are a powerful and convenient way to separate the semantic business data from the markup of an Open XML document. After binding content controls to custom XML, you can query the document for the business data by looking in the custom XML part rather than examining the markup. Querying custom XML is much simpler than querying the document body. However, it’s a little bit involved to create data-bound content controls (but only a little bit). But there is a trick we can Read More...
|
-
You can build very powerful document assembly solutions using the Open XML SDK V2 literally in just a few minutes. In our presentation at PDC 2008, amongst other demos, Zeyad Rajabi and I will demonstrate this in a live coding session. We'll be using the LINQ friendly features of the SDK. It really is a quite a remarkable set of tools, and if you are an Open XML aficionado, you really should attend our session! But even more important than that, we really want to see you, and hear your questions Read More...
|
-
When I was writing the LINQ to XML documentation , Ralf Lämmel was the program manager for LINQ to XSD , an incubation project in the data programmability group at Microsoft. Ralf really helped me a lot in those days, both with questions on LINQ to XML, and questions around functional programming. It was in email exchanges with Ralf that the lights started going on for me around functional programming. So far, LINQ to XSD hasn't become a supported product (I don't know the product team's plans around Read More...
|
-
Many types of documents contain code, including API documentation, tutorials, specifications, technical books, and magazine articles. Too often, there is no way to automate testing and validation of this code. This post presents a small example program that shows how to use content controls in Open XML word documents to delineate code snippets so that you can automate validation of the snippets. This scenario was my first use of Open XML – it was the killer application (for me) that prompted me to Read More...
|
-
Today, the development team for the Open XML SDK has announced that they have released the first Community Technology Preview (CTP) of version 2 of the Open XML SDK. Download it at http://go.microsoft.com/fwlink/?LinkId=127912 . There is a lot of very cool stuff in this release, including: Strongly typed document object model (DOM). Tool to compare two Open XML files. Class explorer that helps you understand the markup and determine which classes to use in the strongly typed DOM. Document reflector Read More...
|
-
Content controls are an effective way to add structure to word processing documents. You can write a very small LINQ query to retrieve the contents of content controls. This topic in Office Online provides more information on content controls. In an upcoming post, I’m going to show how you can write a small test harness to test code that is embedded in documents. This is particularly useful, say, to a program manager who has written a specification that contains a lot of code that shows how to use Read More...
|
-
This post presents a custom application page in SharePoint that uses Open XML, the Open XML SDK and LINQ to XML to accept revisions, remove comments, and remove personal information from an Open XML word processing document. The following 45 second screen-cast demonstrates the code presented in this post. Video: Using Open XML with SharePoint An approach that has interesting possibilities would be to create SharePoint workflows that query and modify Open XML documents. For example, you could write Read More...
|
|
|
|