{"id":338,"date":"2011-03-29T15:00:49","date_gmt":"2011-03-29T15:00:49","guid":{"rendered":"http:\/\/www.ericwhite.com\/home2\/bm8qcmjy\/public_html\/blog\/?p=338"},"modified":"2015-08-26T06:50:44","modified_gmt":"2015-08-26T06:50:44","slug":"release-of-v2-of-doc-gen-system-xpath-in-content-controls","status":"publish","type":"post","link":"https:\/\/www.ericwhite.com\/blog\/2011\/03\/29\/release-of-v2-of-doc-gen-system-xpath-in-content-controls\/","title":{"rendered":"Release of V2 of Doc Gen System: XPath in Content Controls"},"content":{"rendered":"<p>Update August 26, 2015: I have enhanced this document generation system, and published it as part of Open-Xml-PowerTools, which you can find at <a href=\"https:\/\/github.com\/OfficeDev\/Open-Xml-PowerTools\">https:\/\/github.com\/OfficeDev\/Open-Xml-PowerTools<\/a>.  Going forward, I will be enhancing and maintaining that document generation system.  Please feel free to clone \/ fork that repo, report issues on GitHub, and interact with me there.<\/p>\n<p>Today I\u2019m posting the release of version 2 of my simple document generation system.\u00a0 In this example, you configure the document generation process by creating a template document that contains content controls.\u00a0 You then enter XPath expressions in those content controls.\u00a0 Those XPath expressions specify the data that the document generator pulls from the source data.\u00a0 The source data is an XML document that contains data for each and every document that you generate.\u00a0 The source XML document can also contain detail (children records) that populate tables in the generated document.\u00a0 I detailed how the template document works in the post <a href=\"https:\/\/www.ericwhite.com\/blog\/2011\/03\/22\/generating-open-xml-wordprocessingml-documents-using-xpath-expressions-in-content-controls\/\" target=\"_blank\">Generating Open XML WordprocessingML Documents using XPath Expressions in Content Controls<\/a>.<\/p>\n<p>This post is the 14th in a series of blog posts on generating Open XML documents. Here is the complete list: <a href=\"https:\/\/www.ericwhite.com\/blog\/map\/generating-open-xml-wordprocessingml-documents-blog-post-series\/\">Generating Open XML WordprocessingML Documents Blog Post Series<\/a><\/p>\n<p>Download: <a href=\"https:\/\/skydrive.live.com\/redir?resid=5E385848AF211BA9!5731&amp;authkey=!AOs_0PT_ICgWjcg\" target=\"_blank\">Generate Open XML WordprocessingML Documents using XPath Expressions in Content Controls<\/a><\/p>\n<p>In my opinion, the use of XPath expressions in content controls is a superior approach to the one of entering C# code in content controls.\u00a0 The code is cleaner and smaller (this first example is less than 240 lines of code).<\/p>\n<p>I\u2019ve recorded a short (2 minute) screen-cast that demonstrates this example in action.<\/p>\n<div id=\"scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:976aa512-b751-493c-a20d-9bbba78d30f8\" class=\"wlWriterEditableSmartContent\" style=\"margin: 0px; display: inline; float: none; padding: 0px;\">\n<div><object width=\"448\" height=\"252\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" 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\/DdVuqENcAqI?hl=en&amp;hd=1\" \/><embed width=\"448\" height=\"252\" type=\"application\/x-shockwave-flash\" src=\"http:\/\/www.youtube.com\/v\/DdVuqENcAqI?hl=en&amp;hd=1\" \/><\/object><\/div>\n<div style=\"width: 448px; clear: both; font-size: .8em;\">Demonstrates the XPath-in-Content-Controls approach to document generation<\/div>\n<\/div>\n<p>So please download the example, try it out, and give me feedback.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, I release V2 of this simple document generation example.  I provide a 2-minute screen-cast that shows the document generation process, generating 3000 documents in less than 30 seconds.<\/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":[7,3,5],"tags":[],"class_list":["post-338","post","type-post","status-publish","format-standard","hentry","category-document-generation-series","category-open-xml","category-wordprocessingml"],"_links":{"self":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/posts\/338","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=338"}],"version-history":[{"count":7,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/posts\/338\/revisions"}],"predecessor-version":[{"id":1792,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/posts\/338\/revisions\/1792"}],"wp:attachment":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/media?parent=338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/categories?post=338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/tags?post=338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}