How can I preserve the line returns when saving as xml data?

Y

Yufei

Hi,
I use a custom defined schema to apply some xml tags in the Word Document.
Then I save the file as XML file(data only). However, if there are several
paragraphs in one XML tag, the line returns are not preserved in the result
xml. It became one big blog of text.

How can I preserve the line returns in the result xml file?
Thanks
Yufei
KPMG LLP
 
C

Cindy M.

Hi =?Utf-8?B?WXVmZWk=?=,
I use a custom defined schema to apply some xml tags in the Word Document.
Then I save the file as XML file(data only). However, if there are several
paragraphs in one XML tag, the line returns are not preserved in the result
xml. It became one big blog of text.

How can I preserve the line returns in the result xml file?
There's nothing built into Word that will allow you to do this. The argument
during the Word 2003 beta was that in "standard" XML white space is not
preserved. Plus, a Word paragraph is not equivalent to new lines or carriage
returns in a pure text file. Therefore, you need to use a TRANSFORM when
saving that specifies you want to retain the whitespace in the result.

If you want to pursue this, I recommend posting to the XSLT newsgroup, or
perhaps to the office.xml newsgroup (although there's little activity there).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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