Word 2007 xml doument的基本部分 [英] Essential parts of a Word 2007 xml doument

查看:99
本文介绍了Word 2007 xml doument的基本部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个XML文件,需要使用Microsoft Word 2007打开.我是自己写的.但是当我尝试打开它时,它会显示某些零件丢失或无效".我认为发生这种情况是我的文档没有定义所有必需的属性.因此,我需要知道可以使用Word 2007打开的xml文档的必备条件.我定义了以下属性.

I have a xml file which I need to open with Microsoft Word 2007. I wrote it on my own. But when I try to open it tells "Some parts are missing or invalid". I think this happens my document does not have all the requied properties defined. So I need to know what are the must-haves for an xml document to be able to be opened with Word 2007. I have following properties defined.

cp:coreProperties
w:settings
w:body

(主体具有简单的文本行.) 还需要包括什么?预先感谢.

(The body has a simple text line.) What else need to be included? Thanks in advance.

推荐答案

以Flat OPC XML表示,可以很简单:

Expressed as Flat OPC XML, it can be as simple as:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?mso-application progid="Word.Document"?>
<pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage">
  <pkg:part pkg:name="/_rels/.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="512">
    <pkg:xmlData>
      <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
        <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
      </Relationships>
    </pkg:xmlData>
  </pkg:part>
  <pkg:part pkg:name="/word/document.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml">
    <pkg:xmlData>
      <w:document mc:Ignorable="w14 wp14" xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">
        <w:body>
          <w:p >
            <w:r>
              <w:t>Hello world</w:t>
            </w:r>
          </w:p>
        </w:body>
      </w:document>
    </pkg:xmlData>
  </pkg:part>
</pkg:package>

您是否包含恋爱关系,但缺少其目标部分?还是在某个地方包含relId,但完全失去了关系?

Are you including a relationship, but missing its target part? Or including a relId somewhere, but missing the relationship entirely?

这篇关于Word 2007 xml doument的基本部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆