Formatting data into a word document

J

John Smith

I want to take an XML file with content marked as to content type, and turn
it into a word document, applying formatting for viewing. I have Word2003
(Office Pro 2003).

As an example here is some XML:
<Actor>James</Actor><Line>Hello everyone, have you seen
John?</Line><Actor>Mary</Actor><Line>He said he was going to the
garage.<BR/>I think he's seeing that girl again</Line><Sound>Door
slams</Sound>

Output
James: Hello everyone, have you seen John?
Mary: He said he was going to the garage.
I think he's seeing that girl again
FX: ---- Door Slams ----

Is this something I could do easily in word, or do I have to learn XSLT?

Thanks
Adrian
 
P

Peter Jamieson

I don't think any out-of-the box Word feature will do this for you, but
there are a couple of obvious ways you could probably go:
a. use XSLT, as you suggest. Personally I'd consider using it to transform
your XML into HTML rather than WordProcessingML, as long as the formatting
you're intending to apply is standard HTML stuff (bold, italics etc. etc.)
b. use VBA and the MSXML object to open the file and process the XML,
formatting it yourself.

Peter Jamieson
 
J

John Smith

Hi Peter,
thanks for this. I think I'll xslt as long term the payback will be
better.

Adrian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top