Accepting Revisions in Open XML WordprocessingML Documents

Revision tracking markup in Open XML word-processing documents is one of the more complex areas of the standard. If you first accept tracked revisions, it makes subsequent processing of text in word-processing documents much simpler. As an example, in my current project of transforming Open XML word-processing documents to XHtml, before doing the conversion, I…

6

Working with Numbering in Open XML WordprocessingML

When implementing a conversion of Open XML word processing documents to HTML, one of the interesting issues is accurately converting numbered and bulleted lists.  You must pay special attention to them, because they impact the text that the document contains, but that text isn’t directly in the markup.  If you are accurately extracting the text…

3

Implementing ‘Inheritance’ in XML

Some XML vocabularies implement a powerful XML pattern that is analogous to inheritance in programming language type systems.  Open XML WordprocessingML has these semantics around styles.  When you define a new style, you can base this style on another style, and if the new style doesn’t explicitly define some aspect of the style, the new…

11

Using the SharePoint 2010 Client OM with Open XML – Convert Wiki Page to Open XML Document

This is a clipboard friendly version of example #7, Convert Wiki Page to Open XML Document, from Using the SharePoint 2010 Managed Client Object Model with Open XML. This blog is inactive.New blog: EricWhite.com/blogBlog TOC using System;using System.Linq;using System.IO;using System.Xml.Linq;using Microsoft.SharePoint.Client;using ClientOM = Microsoft.SharePoint.Client;using DocumentFormat.OpenXml.Packaging;using DocumentFormat.OpenXml.Wordprocessing;class RetrieveListItems{    static void Main()    {        ClientContext clientContext =            new ClientContext(“http://intranet.contoso.com”);        List oList = clientContext.Web.Lists.GetByTitle(“Eric’s…

0

Using the SharePoint 2010 Client OM with Open XML – Extract Contents of a Wiki Page

This is a clipboard friendly version of example #6, Extract Contents of a Wiki Page, from Using the SharePoint 2010 Managed Client Object Model with Open XML. This blog is inactive.New blog: EricWhite.com/blogBlog TOC using System;using System.Xml.Linq;using Microsoft.SharePoint.Client;class RetrieveListItems{    static void Main()    {        ClientContext clientContext = new ClientContext(“http://intranet.contoso.com”);        List oList = clientContext.Web.Lists.GetByTitle(“Eric’s Wiki”);        CamlQuery camlQuery = new CamlQuery();        camlQuery.ViewXml = @”<View/>”;        ListItemCollection…

0

Using the SharePoint 2010 Client OM with Open XML – Processing all Documents in a Document Library

This is a clipboard friendly version of example #5, Processing all Documents in a Document Library, from Using the SharePoint 2010 Managed Client Object Model with Open XML. This blog is inactive.New blog: EricWhite.com/blogBlog TOC using System;using System.IO;using System.Linq;using DocumentFormat.OpenXml.Packaging;using DocumentFormat.OpenXml.Wordprocessing;using Microsoft.SharePoint.Client;using ClientOM = Microsoft.SharePoint.Client;class Program{    static private void CopyStream(Stream source, Stream destination)    {        byte[] buffer = new…

0

Using the SharePoint 2010 Client OM with Open XML – Creating a Document

This is a clipboard friendly version of example #4, Creating a Document, from Using the SharePoint 2010 Managed Client Object Model with Open XML. This blog is inactive.New blog: EricWhite.com/blogBlog TOC using System;using System.IO;using DocumentFormat.OpenXml.Packaging;using DocumentFormat.OpenXml.Wordprocessing;using Microsoft.SharePoint.Client;using ClientOM = Microsoft.SharePoint.Client;class Program{    static void Main(string[] args)    {        ClientContext clientContext =            new ClientContext(“http://intranet.contoso.com”);        byte[] byteArray = System.IO.File.ReadAllBytes(“Template.docx”);        using (MemoryStream memoryStream = new MemoryStream())        {            memoryStream.Write(byteArray,…

0

Using the SharePoint 2010 Client OM with Open XML – Uploading a Document

This is a clipboard friendly version of example #3, Uploading a Document, from Using the SharePoint 2010 Managed Client Object Model with Open XML. This blog is inactive.New blog: EricWhite.com/blogBlog TOC using System;using System.IO;using DocumentFormat.OpenXml.Packaging;using DocumentFormat.OpenXml.Wordprocessing;using Microsoft.SharePoint.Client;// The following directive is used to avoid ambiguity between the// System.IO.File and Microsoft.SharePoint.Client.File classes.using ClientOM = Microsoft.SharePoint.Client;class Program{    static…

0

Using the SharePoint 2010 Client OM with Open XML – Modifying a Document

This is a clipboard friendly version of example #2, Modifying a Document, from Using the SharePoint 2010 Managed Client Object Model with Open XML. This blog is inactive.New blog: EricWhite.com/blogBlog TOC using System;using System.IO;using System.Linq;using DocumentFormat.OpenXml.Packaging;using DocumentFormat.OpenXml.Wordprocessing;using Microsoft.SharePoint.Client;using ClientOM = Microsoft.SharePoint.Client;class Program{    static private void CopyStream(Stream source, Stream destination)    {        byte[] buffer = new byte[32768];        int bytesRead;        do        {            bytesRead = source.Read(buffer,…

0

Using the SharePoint 2010 Client OM with Open XML – Retrieving a Document

This is a clipboard friendly version of example #1, Retrieving a Document, from Using the SharePoint 2010 Managed Client Object Model with Open XML. This blog is inactive.New blog: EricWhite.com/blogBlog TOC using System;using System.IO;using System.Linq;using DocumentFormat.OpenXml.Packaging;using DocumentFormat.OpenXml.Wordprocessing;using Microsoft.SharePoint.Client;// The following using directive is used to resolve the ambiguity// between the System.IO.File and Microsoft.SharePoint.Client.File// classes.using ClientOM…

0