开发者

xml:space="preserve" in Word 2003 XML document

I'm using XSLT templates to generate word documents in XML format.

The problem I'm having is with whitespaces (specifically - tabs).

This is an example of a tab inside a paragraph in xml doc:

<w:p>
<w:r xml:space="preserve">
<w:tab />
<w:t>This is some text after tab</w:t>
</w:r>
</w:p>

I added xml:space="preserve" to save the whitespace generated by tab, and this works in Word2007 (it opens up correctly) but it doesn't in Word2003. For Word2003 I have to put xml:space="preserve" tag inside the root element of w:wordDocument. This is a problem, since we do have a lot of spaces in our generated xml's and the default of ignoring them is a requirement.

I know that Microsofts apps开发者_如何学JAVA tend to ignore standards misuse and just assume what the user wanted without showing error. I thought that might be the error here since the word2003 and 2007 have different interpretation of the same format. If that's the case - how to correctly set this?


Word 2007 puts xml:space="preserve" on the w:t element when required.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜