O'Reilly logo

Microsoft® .NET Compact Framework Kick Start by Ronnie Yates, Erik Rubin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Inserting XmlNodes

It is important to remember that the XmlNode creation method creates an XmlNode only in the context of the current document. It does not, however, add the XmlNodes to the document. You must explicitly insert the nodes into the document tree. The XmlNode class provides several methods for adding nodes to the document tree.

Before we begin discussing the insertion methods, let's talk about which nodes can contain other nodes. Not all nodes are container nodes, and not all container nodes can contain every node type. For example, an XmlAttribute node is a container node that can contain only XmlText nodes. It cannot contain an XmlProcessingInstruction node. An InvalidOperationException is raised when a specified node cannot be ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required