D
Dave
I am a newbie to XML. I am trying to replace a node by using the ReplaceChild
function. The element s in the node to be replaced all have a prefix of"mml".
However when I try using the following code
XmlElement elem = doc.CreateElement("mml","cn",xmlns.ToString());
elem.InnerText = "mytext";
mathExprList[0].ReplaceChild(elem, mathExprList[0].LastChild);
doc.Save(@"..\..\MathML1.xml");
I get the following line in my XML document:
<mml:cn xmlns:mml="System.Xml.XmlNamespaceManager">mytext</mml:cn>
I would like to get this instead:
<mml:cn>mytext</mml:cn>
function. The element s in the node to be replaced all have a prefix of"mml".
However when I try using the following code
XmlElement elem = doc.CreateElement("mml","cn",xmlns.ToString());
elem.InnerText = "mytext";
mathExprList[0].ReplaceChild(elem, mathExprList[0].LastChild);
doc.Save(@"..\..\MathML1.xml");
I get the following line in my XML document:
<mml:cn xmlns:mml="System.Xml.XmlNamespaceManager">mytext</mml:cn>
I would like to get this instead:
<mml:cn>mytext</mml:cn>