Word 2003 XML problem

Discussion in 'ASP.NET / ASP.NET Core' started by PhillyRob, Dec 10, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have created a WordXML document by adding XML tags to an existing document. Similar to a mail merge, I would like to be able to use this document as a template and replace the data contained within the tags, with data from a separate (standard) XML file.

    I do not like the idea of having to use XSLTs to tranform the XML document as most web sites suggest. Is there some way of manipulating the WordXML document, to replace the data within the XML tags, with the data contained in a separate XML file??

    Or maybe copy the parts of the WordXML that handle the formatting, into the XML file containing the new data, so that when opened it will look the same as the original WordXML document? (I'm clutching at straws now :S )

    Any suggestions would be much appreciated :)
     
  2. Another idea would be to load the WordXML documment into an XML DOM and select the xpath to the data you want to change then update it with the data from your other xml file. a.la

    xmldom.load("wordXML.xml");

    changenode = xmldom.selectSingleNode("\\xpath to data in word doc")

    changenode.nodeTypedValue = new value

    Would work ok but....

    If your word doc is really big you may want to consider using SAX instead.

    If you change the word template it means a recompile as you'll have to change code, which is why I've gone for the xslt approach - much easier to maintain.

    XBOXRacing.net

    Tournaments, Leagues & Prizes
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page