<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>XSLT</title>
        <link>http://blogs.3sharp.com/davidg/category/90.aspx</link>
        <description>XSLT</description>
        <language>en-US</language>
        <copyright>David Gerhardt</copyright>
        <managingEditor>davidg@3sharp.com</managingEditor>
        <generator>Subtext Version 1.9.5.177</generator>
        <item>
            <title>Converting an InfoPath 2007 Form into a Word 2007 Document</title>
            <link>http://blogs.3sharp.com/davidg/archive/2008/08/08/4935.aspx</link>
            <description>With the introduction of the Office Open XML Formats in the 2007 release, the process for programmatically using XSLT to generate Word 2007 documents has changed somewhat since the Office 2003 days. For those of you not interested in working with XSLT, this post describes an alternative for programmatically generating Word 2007 documents from InfoPath 2007 forms...&lt;img src="http://blogs.3sharp.com/davidg/aggbug/4935.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Gerhardt</dc:creator>
            <guid>http://blogs.3sharp.com/davidg/archive/2008/08/08/4935.aspx</guid>
            <pubDate>Fri, 08 Aug 2008 22:20:11 GMT</pubDate>
            <wfw:comment>http://blogs.3sharp.com/davidg/comments/4935.aspx</wfw:comment>
            <comments>http://blogs.3sharp.com/davidg/archive/2008/08/08/4935.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://blogs.3sharp.com/davidg/comments/commentRss/4935.aspx</wfw:commentRss>
        </item>
        <item>
            <title>XSLT 2.0 and XPath 2.0</title>
            <link>http://blogs.3sharp.com/davidg/archive/2007/01/23/2803.aspx</link>
            <description>&lt;p&gt;The &lt;a href="http://www.w3.org/"&gt;World Wide Web Consortium (W3C)&lt;/a&gt; published a few recommendations today, two of which include &lt;a href="http://www.w3.org/TR/2007/REC-xslt20-20070123/"&gt;XSLT 2.0&lt;/a&gt; and &lt;a href="http://www.w3.org/TR/2007/REC-xpath20-20070123/"&gt;XPath 2.0&lt;/a&gt;. The Version 1.0 recommendations for these XML standards were published in November 1999, so updates were long overdue. However, there are products currently available that already use the standards. XSLT processors such as &lt;a href="http://saxon.sourceforge.net/"&gt;Saxon&lt;/a&gt; have been compliant with XSLT 2.0 and XPath 2.0 working drafts and candidate recommendations for several years now. It will be interesting to see how quickly other technologies incorporate the updates...&lt;/p&gt;&lt;img src="http://blogs.3sharp.com/davidg/aggbug/2803.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Gerhardt</dc:creator>
            <guid>http://blogs.3sharp.com/davidg/archive/2007/01/23/2803.aspx</guid>
            <pubDate>Tue, 23 Jan 2007 17:34:00 GMT</pubDate>
            <wfw:comment>http://blogs.3sharp.com/davidg/comments/2803.aspx</wfw:comment>
            <comments>http://blogs.3sharp.com/davidg/archive/2007/01/23/2803.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.3sharp.com/davidg/comments/commentRss/2803.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Good Online XSLT Resource</title>
            <link>http://blogs.3sharp.com/davidg/archive/2006/02/16/1251.aspx</link>
            <description>&lt;p&gt;Michael Kay, editor of the &lt;a href="http://www.w3.org/TR/xslt20/"&gt;W3C XSLT 2.0 candidate recommendation&lt;/a&gt; and author of several &lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/index=books&amp;amp;field-author-exact=Michael%20Kay&amp;amp;rank=-relevance%2C%2Bavailability%2C-daterank/103-9835310-1566242"&gt;reference books&lt;/a&gt; for XSLT and XPath, recently joined the blogging community. On February 3 Kay launched &lt;a href="http://saxonica.blogharbor.com/blog"&gt;Saxon Diaries&lt;/a&gt;, which focuses on his &lt;a href="http://www.saxonica.com/products.html"&gt;Saxon processor&lt;/a&gt; but also has general information related to XSLT, XPath, and XQuery. Kay's site is a welcome addition to the relatively small number of online XSLT resources.&lt;/p&gt;&lt;img src="http://blogs.3sharp.com/davidg/aggbug/1251.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Gerhardt</dc:creator>
            <guid>http://blogs.3sharp.com/davidg/archive/2006/02/16/1251.aspx</guid>
            <pubDate>Thu, 16 Feb 2006 18:43:00 GMT</pubDate>
            <wfw:comment>http://blogs.3sharp.com/davidg/comments/1251.aspx</wfw:comment>
            <comments>http://blogs.3sharp.com/davidg/archive/2006/02/16/1251.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.3sharp.com/davidg/comments/commentRss/1251.aspx</wfw:commentRss>
        </item>
        <item>
            <title>More on Transforming InfoPath Images into WordML</title>
            <link>http://blogs.3sharp.com/davidg/archive/2005/11/08/978.aspx</link>
            <description>Last month, I wrote about transforming InfoPath form files that contain ink picture controls into Word 2003 documents. That task involved getting the ink picture data and associated background image from the form file into WordML. This month, the task at hand was the transformation of form files with a variable number of images into WordML. This type of transformation is similar to the one regarding the ink picture, except that the number of images to be transformed at runtime is unknown...&lt;img src="http://blogs.3sharp.com/davidg/aggbug/978.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Gerhardt</dc:creator>
            <guid>http://blogs.3sharp.com/davidg/archive/2005/11/08/978.aspx</guid>
            <pubDate>Tue, 08 Nov 2005 20:21:00 GMT</pubDate>
            <wfw:comment>http://blogs.3sharp.com/davidg/comments/978.aspx</wfw:comment>
            <comments>http://blogs.3sharp.com/davidg/archive/2005/11/08/978.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://blogs.3sharp.com/davidg/comments/commentRss/978.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Transforming an InfoPath Ink Picture into WordML</title>
            <link>http://blogs.3sharp.com/davidg/archive/2005/10/21/956.aspx</link>
            <description>On a current project I was tasked with using XSLT to transform InfoPath form files into Word 2003 documents. The InfoPath form template used to create the XML input was designed for a tablet PC and thus had an ink picture control, the data for which needed to appear in the corresponding Word document. To complicate matters, the ink picture in the form template used a background image, which also needed to be output in Word...&lt;img src="http://blogs.3sharp.com/davidg/aggbug/956.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Gerhardt</dc:creator>
            <guid>http://blogs.3sharp.com/davidg/archive/2005/10/21/956.aspx</guid>
            <pubDate>Fri, 21 Oct 2005 17:46:00 GMT</pubDate>
            <wfw:comment>http://blogs.3sharp.com/davidg/comments/956.aspx</wfw:comment>
            <comments>http://blogs.3sharp.com/davidg/archive/2005/10/21/956.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://blogs.3sharp.com/davidg/comments/commentRss/956.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Transforming InfoPath Rich Text into WordML</title>
            <link>http://blogs.3sharp.com/davidg/archive/2005/08/12/920.aspx</link>
            <description>&lt;p&gt;&lt;b&gt;NOTE:&lt;/b&gt; This post is actually a repeat of one that was authored last June. Unfortunately, that post resides on another blog server that is no longer public. So, in response to a recent question about transforming InfoPath rich text into Word, I have decided to re-post. Amazingly, the content is still valid, even though Microsoft has since released its XSLT Inference Tool...&lt;/p&gt;&lt;img src="http://blogs.3sharp.com/davidg/aggbug/920.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Gerhardt</dc:creator>
            <guid>http://blogs.3sharp.com/davidg/archive/2005/08/12/920.aspx</guid>
            <pubDate>Fri, 12 Aug 2005 20:41:00 GMT</pubDate>
            <wfw:comment>http://blogs.3sharp.com/davidg/comments/920.aspx</wfw:comment>
            <comments>http://blogs.3sharp.com/davidg/archive/2005/08/12/920.aspx#feedback</comments>
            <slash:comments>16</slash:comments>
            <wfw:commentRss>http://blogs.3sharp.com/davidg/comments/commentRss/920.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Generating WordML in InfoPath and Opening the Results in Word</title>
            <link>http://blogs.3sharp.com/davidg/archive/2004/12/17/183.aspx</link>
            <description>&lt;p&gt;We were recently tasked with generating WordML output from an InfoPath SP1 form and then loading the output in Word. The XSL stylesheet for our transform had already been developed, and it was too complex for the InfoPath to Word Wizard (which is included in the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=351F0616-93AA-4FE8-9238-D702F1BFBAB4&amp;amp;displaylang=en"&gt;InfoPath 2003 SDK&lt;/a&gt;). As a result, we were left to solve the problem using managed code in our form solution.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.3sharp.com/blog/johnp"&gt;John&lt;/a&gt; and I separately found the same &lt;a href="http://groups-beta.google.com/group/microsoft.public.infopath/browse_thread/thread/cdaa3cd44efe055a/13fbaf49f0aa8851?q=infopath+%22load+transform%22&amp;amp;_done=%2Fgroups%3Fhl%3Den%26q%3Dinfopath+%22load+transform%22%26&amp;amp;_doneTitle=Back+to+Search&amp;amp;&amp;amp;d#13fbaf49f0aa8851"&gt;reference&lt;/a&gt;, which demonstrated how an XSL resource file could be used to transform a form's data source. We took that example and went a few steps further, saving the result of the transform to an XmlDocument object, instantiating Word, and inserting the XmlDocument object into a new Word document. Our code looked as follows:&lt;/p&gt;
&lt;code&gt;// First create a COM DOM and load the XSL resource file into that DOM.&lt;br /&gt;
IXMLDOMDocument domDocument = thisXDocument.CreateDOM();&lt;br /&gt;
domDocument.load("EmployeeReview.xsl");&lt;br /&gt;
&lt;br /&gt;
// Create an XmlDocument object and load the XML of the DOM.&lt;br /&gt;
XmlDocument xsltDocument = new XmlDocument();&lt;br /&gt;
xsltDocument.LoadXml(domDocument.xml);&lt;br /&gt;
&lt;br /&gt;
// Load the InfoPath XML into an XmlDocument object.&lt;br /&gt;
XmlDocument infoPathDocument = new XmlDocument();&lt;br /&gt;
infoPathDocument.LoadXml(thisXDocument.DOM.xml);&lt;br /&gt;
&lt;br /&gt;
// Load the XSL XmlDocument object into an XslTransform object.&lt;br /&gt;
XslTransform xslt = new XslTransform();&lt;br /&gt;
xslt.Load(xsltDocument.CreateNavigator(), new XmlUrlResolver(),&lt;br /&gt;
  this.GetType().Assembly.Evidence);&lt;br /&gt;
&lt;br /&gt;
// Create an output XmlDocument object and load the results of the transform.&lt;br /&gt;
XmlDocument outputDoc = new XmlDocument();&lt;br /&gt;
outputDoc.Load(xslt.Transform(infoPathDocument.CreateNavigator(), null, new XmlUrlResolver()));&lt;br /&gt;
&lt;br /&gt;
// Instantiate Word and insert the output XmlDocument object into a new document.&lt;br /&gt;
object missing = System.Reflection.Missing.Value;&lt;br /&gt;
Word.Application wordApp = new Word.ApplicationClass();&lt;br /&gt;
Word.Document oDoc = new Word.DocumentClass();&lt;br /&gt;
oDoc = wordApp.Documents.Add(ref missing, ref missing, ref missing, ref missing);&lt;br /&gt;
wordApp.Selection.Range.InsertXML(outputDoc.OuterXml,ref missing);&lt;br /&gt;
wordApp.Visible = true; &lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;Note that using this code requires references to the Word COM object (Microsoft Word 11.0 Object Library) and the System.Xml.dll .NET component. In addition, the following directives were added to our form code file:&lt;/p&gt;
&lt;code&gt;using System.Xml;&lt;br /&gt;
using System.Xml.Xsl;&lt;br /&gt;
using Word = Microsoft.Office.Interop.Word ; &lt;/code&gt;&lt;img src="http://blogs.3sharp.com/davidg/aggbug/183.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>David Gerhardt</dc:creator>
            <guid>http://blogs.3sharp.com/davidg/archive/2004/12/17/183.aspx</guid>
            <pubDate>Fri, 17 Dec 2004 09:24:00 GMT</pubDate>
            <wfw:comment>http://blogs.3sharp.com/davidg/comments/183.aspx</wfw:comment>
            <comments>http://blogs.3sharp.com/davidg/archive/2004/12/17/183.aspx#feedback</comments>
            <slash:comments>12</slash:comments>
            <wfw:commentRss>http://blogs.3sharp.com/davidg/comments/commentRss/183.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>