XML文档中的双引号转义了(`“`),当我打开它时,它将解码所有转义的字符,当保存时,它将不会转义双引号'”`。
我如何确保将"
另存为"
?
我用来执行此操作的代码:
XmlDocument xliffDoc = new XmlDocument();
xliffDoc.Load(filePath);
XmlNamespaceManager xmlNSS = new XmlNamespaceManager(xliffDoc.NameTable);
xmlNSS.AddNamespace("st-xmlns", @"urn:oasis:names:tc:xliff:document:1.2");
foreach (XmlNode transUnit in transUnits)
{
//Change innerXML while keeping the structure
}
xliffDoc.Save(filePath);
我希望未更改的内容按原样保存:
.....
<trans-unit id="17645" identifier="5df0c6519f50ac44d2e9c94c1cf841d4" approved="yes">
<source>LDL ("Bad" Cholesterol)</source>
<target>LDL („Schlechtes“ Cholesterin)</target>
<note>Context: me.body.ldl.text</note>
</trans-unit>
.....
但是我得到了
.....
<trans-unit id="17645" identifier="5df0c6519f50ac44d2e9c94c1cf841d4" approved="yes">
<source>LDL ("Bad" Cholesterol)</source>
<target>LDL („Schlechtes“ Cholesterin)</target>
<note>Context: me.body.ldl.text</note>
</trans-unit>
.....