Editing Word 2007 XML – choose your tools wisely!

I’m currently involved in a project that involves effectively ‘mail-merging’ and formatting a document based on external data. As certain sections need to disappear and others need to repeat I am actually using an XSL to generate my MS Word document.

However, I’m finding that after each change/iteration I have to look very carefully at the output document. Thus far this is what I’ve found – sometimes when Oxygen XML reformats the XML the ouput Word document contains lots of white space mid-paragraph on long paragraphs. This is due to the <w:t
tags where the text of the paragraph spans multiple lines. The XML indentation is effectively being shown in Word. Other XML editors will probably have the same issue – BEWARE!

Altova DiffDog is very useful to work out what has changed when things do go wrong with the exception of whitespace issues. Beware though, it doesn’t appear to be able to cope with curved apostrophes or quotes (the type word does for you and aren’t part of ASCII !). Thus if you save any changes you make using DiffDog your Word document will end up full of those pesky empty white boxes signifying strange characters. See below:

Altova DiffDog

Visual Studio 2008


Note that Altova XMLSpy does display these characters correctly however I’m now using Visual Studio 2008 (SP1) for editing the XML/XSL and so far so good…

DISCLAIMER: I’m no expert with these things so it’s quite likely I’m missing a setting somewhere, if so please let me know.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s