J
JY
Hi,
I'm using XMLNavigator to replace a range in an XML file. The code is as
follows:
XPathNavigator navigator = documentXML.CreateNavigator();
XPathNavigator navIRV =
navigator.SelectSingleNode(@"//w
[w:customXml/@w:element=""My_ID1""]",
namespaceManager);
navIRV.MoveToChild("customXml", wordprocessingML);
navIRV.MoveToChild("r", wordprocessingML);
XmlWriter xmlWriter = navIRV.ReplaceRange(navIRV);
xmlWriter.WriteStartElement("w", "t", wordprocessingML);
xmlWriter.WriteEndElement();
xmlWriter.Close();
While debugging I see that it is getting written properly. However, when I
try to open the created XML file, I see some more data added after the actual
end of the file. Not sure what is going wrong, appreciate any help.
TIA,
JY
I'm using XMLNavigator to replace a range in an XML file. The code is as
follows:
XPathNavigator navigator = documentXML.CreateNavigator();
XPathNavigator navIRV =
navigator.SelectSingleNode(@"//w

namespaceManager);
navIRV.MoveToChild("customXml", wordprocessingML);
navIRV.MoveToChild("r", wordprocessingML);
XmlWriter xmlWriter = navIRV.ReplaceRange(navIRV);
xmlWriter.WriteStartElement("w", "t", wordprocessingML);
xmlWriter.WriteEndElement();
xmlWriter.Close();
While debugging I see that it is getting written properly. However, when I
try to open the created XML file, I see some more data added after the actual
end of the file. Not sure what is going wrong, appreciate any help.
TIA,
JY