{"id":291,"date":"2011-03-09T23:53:43","date_gmt":"2011-03-09T23:53:43","guid":{"rendered":"http:\/\/www.ericwhite.com\/home2\/bm8qcmjy\/public_html\/blog\/?p=291"},"modified":"2018-05-31T22:26:13","modified_gmt":"2018-05-31T22:26:13","slug":"getting-started-with-open-xml-powertools-markup-simplifier","status":"publish","type":"post","link":"https:\/\/www.ericwhite.com\/blog\/2011\/03\/09\/getting-started-with-open-xml-powertools-markup-simplifier\/","title":{"rendered":"Getting Started with Open XML PowerTools Markup Simplifier"},"content":{"rendered":"<p>On OpenXmlDeveloper.org, in one of the forums, there is a thread about how to clean Word proofing errors clutter out of an Open XML WordprocessingML document.\u00a0 In PowerTools, in the HtmlConverter project, there is a class called MarkupSimplifier, which can remove proofing errors.\u00a0 In addition, it can simplify WordprocessingML markup in a variety of ways, including removal of comments, content controls, and etc.\u00a0 The blog post, <a href=\"http:\/\/blogs.msdn.com\/b\/ericwhite\/archive\/2010\/02\/08\/enabling-better-transformations-by-simplifying-open-xml-wordprocessingml-markup.aspx\" class=\"broken_link\">Enabling Better Transformations by Simplifying Open XML WordprocessingML Markup<\/a> describes MarkupSimplifier in more detail.<\/p>\n<p>Here is a small screen-cast that shows the use of MarkupSimplifier. \u00a0In the screen-cast, I use <a href=\"http:\/\/visualstudiogallery.msdn.microsoft.com\/450a00e3-5a7d-4776-be2c-8aa8cec2a75b\/\">Open XML Package Editor Power Tool for Visual Studio 2010<\/a>.<\/p>\n<div id=\"scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:df7031be-713c-4984-a371-6feb8a706dea\" class=\"wlWriterEditableSmartContent\" style=\"margin: 0px; display: inline; float: none; padding: 0px;\">\n<div><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"448\" height=\"252\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0\"><param name=\"src\" value=\"http:\/\/www.youtube.com\/v\/LBFAXNlEBFA?hl=en&amp;hd=1\" \/><embed type=\"application\/x-shockwave-flash\" width=\"448\" height=\"252\" src=\"http:\/\/www.youtube.com\/v\/LBFAXNlEBFA?hl=en&amp;hd=1\"><\/embed><\/object><\/div>\n<div style=\"width: 448px; clear: both; font-size: .8em;\">Walks through the process of downloading and compiling a sample for MarkupSimplifier.<\/div>\n<\/div>\n<p><\/p>\n<p>Here is the listing of the small program that uses MarkupSimplifier<\/p>\n<p><code>using&nbsp;System;<br \/>\nusing&nbsp;System.Collections.Generic;<br \/>\nusing&nbsp;System.Linq;<br \/>\nusing&nbsp;System.Text;<br \/>\nusing&nbsp;OpenXmlPowerTools;<br \/>\nusing&nbsp;DocumentFormat.OpenXml.Packaging;<\/p>\n<p>class&nbsp;Program<br \/>\n{<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;static&nbsp;void&nbsp;Main(string[]&nbsp;args)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;{<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;(WordprocessingDocument&nbsp;doc&nbsp;=<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WordprocessingDocument.Open(\"Test.docx\",&nbsp;true))<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SimplifyMarkupSettings&nbsp;settings&nbsp;=&nbsp;new&nbsp;SimplifyMarkupSettings<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RemoveComments&nbsp;=&nbsp;true,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RemoveContentControls&nbsp;=&nbsp;true,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RemoveEndAndFootNotes&nbsp;=&nbsp;true,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RemoveFieldCodes&nbsp;=&nbsp;false,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RemoveLastRenderedPageBreak&nbsp;=&nbsp;true,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RemovePermissions&nbsp;=&nbsp;true,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RemoveProof&nbsp;=&nbsp;true,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RemoveRsidInfo&nbsp;=&nbsp;true,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RemoveSmartTags&nbsp;=&nbsp;true,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RemoveSoftHyphens&nbsp;=&nbsp;true,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ReplaceTabsWithSpaces&nbsp;=&nbsp;true,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MarkupSimplifier.SimplifyMarkup(doc,&nbsp;settings);<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>\n}<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On OpenXmlDeveloper.org, in one of the forums, there is a thread about how to clean Word proofing errors clutter out of an Open XML WordprocessingML document.\u00a0 In PowerTools, in the HtmlConverter project, there is a class called MarkupSimplifier, which can remove proofing errors.\u00a0 In addition, it can simplify WordprocessingML markup in a variety of ways, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_s2mail":"","footnotes":""},"categories":[3,9,5],"tags":[],"class_list":["post-291","post","type-post","status-publish","format-standard","hentry","category-open-xml","category-powertools","category-wordprocessingml"],"_links":{"self":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/posts\/291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/comments?post=291"}],"version-history":[{"count":9,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/posts\/291\/revisions"}],"predecessor-version":[{"id":7346,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/posts\/291\/revisions\/7346"}],"wp:attachment":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/media?parent=291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/categories?post=291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/tags?post=291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}