wordpress hit counter
Can I have an xsl template that is always applied to a word document on data change? - WordprocessingML - Formats - OpenXML Developer

Can I have an xsl template that is always applied to a word document on data change?

Formats

Discussions about working with different Open XML Formats

Can I have an xsl template that is always applied to a word document on data change?

  • rated by 0 users
  • This post has 2 Replies |
  • 1 Follower
  • I created an xsl transformation that can transform an xml file to a Word document, I opened the xml document with Microsoft Word, and applied the xslt over the document, and I was very impressed by the results.

     

    The problem is, when I programmatically change the xml document that is in the background, the word document does not update itself; for example, if the xsl is used to generate a table, and I added a new row to the xml, Microsoft Word does not add a new row to the table.

     

    The only way to do that is to apply a new transform on the document again, is it possible to have one xsl transformation always on?

     

    The same like InfoPath, there is an xslt behind, and each time you change something in the xml data, the xslt refreshes the screen.

     

    Are Microsoft Word 2007 and OpenXml the same?

  • Hi,

    Have you saved the xml file after modifying programmatically?

    i.e

    //Open the xml file
    XmlDocument xDoc = new XmlDocument();
                xDoc.Load(@"path");

    //Modify

    //Save
    xDoc.Save(@"path");

    I have simulated the scenario and is working fine.

    Sheela

     

  • The xml is saved, and the xslt works, but my problem is the re render of the document.

    For example:

    I created an XML file and saved it.

    I opened it with Microsoft Word, and applied the XSLT over it.

    I programmatically modified the XML document using the Word object module and Interop (C#).

    Once I modify the xml, the Word document is not refreshed; comparing it to Microsoft InfoPath, if I modify the XML in InfoPath for example, the xslt will immediately update the document content.

    In Microsoft Word, the only way that I found is to apply a transform against the entire document, and it is manual, not like InfoPath where the XSLT is live.

Page 1 of 1 (3 items)