Patrick wrote:
Quote:
singleNode = mDoc.SelectSingleNode("//page[@id=\"" + pageid.Value +
"\"]");
if (singleNode == null)
{
Response.Write("no node found");
return;
}
mAttr.Value = "100";
newNode.Attributes.Append(mAttr);
mDoc.DocumentElement.InsertAfter(newNode, singleNode); |
Use
singleNode.ParentNode.InsertAfter(newNode, singleNode);
You always have to call AppendChild or InsertAfter or InsertBefore on
the new parent node where you want to append or insert the new child.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/