gpt4 book ai didi

xml - "The file.docx cannot be opened because there are problems with the contents."位置部分 :/word/document. xml

转载 作者:行者123 更新时间:2023-12-05 06:47:09 27 4
gpt4 key购买 nike

一些用户一直非常反复地面对文档损坏问题。

我们有一个使用 Webdav 在服务器上存储 Word 文档的应用程序。在服务器上访问和编辑这些文档的用户可能是office 2007和office 2010。大部分文档是共享的,可以被office 2007和office 2010用户访问编辑。

许多用户遇到文档损坏问题并出现以下错误。==>“无法打开文件 xxx,因为”内容有问题“细节:没有可用的错误详细信息。位置部分:/word/document.xml Line:1 column 0

为该文档格式化 document.xml 文件后,我发现错误指向行 =>

有问题的 XML 节点在下面提供的 XML 节点中。所有损坏的文档都具有相同的行为。它们都指向相同的 XML 标记。如果我取出完整的节点,文档可以正常打开。

 <w:drawing>
<wp:inline distT="0" distB="0" distL="0" distR="0">
<wp:extent cx="4572638" cy="3429479" />
<wp:effectExtent l="0" t="0" r="0" b="0" />
<wp:docPr id="1026" />
<wp:cNvGraphicFramePr>
<a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1" />
</wp:cNvGraphicFramePr>
<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:nvPicPr>
<pic:cNvPr id="0" />
<pic:cNvPicPr>
<a:picLocks noChangeAspect="1" />
</pic:cNvPicPr>
</pic:nvPicPr>
<pic:blipFill>
<a:blip r:embed="rId4" />
<a:stretch>
<a:fillRect />
</a:stretch>
</pic:blipFill>
<pic:spPr>
<a:xfrm>
<a:off x="0" y="0" />
<a:ext cx="4572638" cy="3429479" />
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst />
</a:prstGeom>
</pic:spPr>
</pic:pic>
</a:graphicData>
</a:graphic>
</wp:inline>
</w:drawing>

在我的本地机器上保存文档并使用打开和修复选项打开它之后,有问题的标签看起来像这样 => 完整的节点看起来像如下所示。

 <w:drawing>
<wp:inline distT="0" distB="0" distL="0" distR="0">
<wp:extent cx="4572638" cy="3429479"/>
<wp:effectExtent l="0" t="0" r="0" b="0"/>
<wp:docPr id="1026" name="Picture 1026"/>
<wp:cNvGraphicFramePr>
<a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/>
</wp:cNvGraphicFramePr>
<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:nvPicPr>
<pic:cNvPr id="0" name=""/>
<pic:cNvPicPr>
<a:picLocks noChangeAspect="1"/>
</pic:cNvPicPr>
</pic:nvPicPr>
<pic:blipFill>
<a:blip r:embed="rId8"/>
<a:stretch>
<a:fillRect/>
</a:stretch>
</pic:blipFill>
<pic:spPr>
<a:xfrm>
<a:off x="0" y="0"/>
<a:ext cx="4572638" cy="3429479"/>
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst/>
</a:prstGeom>
</pic:spPr>
</pic:pic>
</a:graphicData>
</a:graphic>
</wp:inline>
</w:drawing>

请帮我解决这个问题。

最佳答案

简短的回答是“name”是 docPr 和 cNvPr 元素的必需属性:

<xsd:complexType name="CT_PictureNonVisual">
<xsd:sequence>
<xsd:element name="cNvPr" type="a:CT_NonVisualDrawingProps"/>
...
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="CT_Inline">
<xsd:sequence>
...
<xsd:element name="docPr" type="a:CT_NonVisualDrawingProps"/>
...
</xsd:sequence>
...
</xsd:complexType>

<xsd:complexType name="CT_NonVisualDrawingProps">
...
<xsd:attribute name="id" type="ST_DrawingElementId" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required"/>
...
</xsd:complexType>

我将不得不猜测该属性在流程中的哪个位置被遗漏或删除。但是如果没有它,document.xml 部分就不是有效的模式,这将解释需要修复步骤。

关于xml - "The file.docx cannot be opened because there are problems with the contents."位置部分 :/word/document. xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12592296/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com