更新的行从XML文件中消失 [英] Updated line disappears from an XML file

查看:100
本文介绍了更新的行从XML文件中消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个word文档的XML文件,手动添加一组行并将其保存在notepad ++中。它甚至得到了保存,当我打开那个XML文件时,更改仍然存在,但如果我保存WORD文档,那么我在XML文件中手动输入的行集就会消失。



I have an XML file of a word document ,there am manually adding a set of line and saving it in notepad++. It is even getting saved and when i open that XML file in word the changes still there but if once i save the WORD document ,then the set of line which i have manually entered in the XML file disappers.

<w:r>
<w:rPr>
<w:rFonts w:eastAsia="Times New Roman"/>
<w:bCs w:val="0"/>
<w:spacing w:val="5"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:lang w:val="en-US"/>
</w:rPr>
<w:note w:val="12" />     **// This is the line am adding manually**
<w:t>Document3 Purpose</w:t>
</w:r>



一旦我打开XML单词,如果我保存它,那么这些行就会从相应的单词XML中消失。


once if i open the XML in word and if i save it ,then these line's getting disappeared from corresponding words XML.

推荐答案

元素< w:注意w:val =12xmlns:w =#unknown/> 可能在元素< w:r xmlns:w =#unknown>< ; / W:R> 。元素< w:r xmlns:w =#unknown>< / w:r> 可能没有的处理程序注意元素。



从编码的角度来看更清楚:元素被映射到内部类。它查找能够与数据匹配的类,但没有具有可选note属性的类。由于未找到匹配的类,因此将丢弃完整元素。



如果他们正确编程,元素将被存储到某些UnknownElementContainerClass中,当文档被保存时,它只是将其写回输出文件。也许该软件的另一个版本确实知道如何处理这个元素,所以应该保留。



希望你现在理解它好一些。因为你破坏了一块钥匙,所以它不适用于你拥有的锁。 (但它可以使用另一个锁,但锁不知道)。



祝你好运!
The element <w:note w:val="12" xmlns:w="#unknown" /> is probably mandatory in the element <w:r xmlns:w="#unknown"></w:r>. There probably is no handler for element <w:r xmlns:w="#unknown"></w:r> without the note element.

To make it more clear from the perspective of coding: The elements are mapped to internal classes. It looks for a class that is able to match with the data but there isn't a class with an optional note property. Because no matching class is found the complete element is discarded.

If they programmed it correctly, the element would simply be stored into somekind of UnknownElementContainerClass and when the document is saved it simply writes it back to the output file. Maybe another version of the software does know how to handle this element so should be preserved.

Hopefully you understand it somewhat better now. Because you broke of a piece of the key, it doesn't work with the lock you have. (But it could however work with another lock, but the lock doesn't "know").

Good luck!


这篇关于更新的行从XML文件中消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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