« System.Web.HttpUtility.UrlEncode | Main | Debugging Properties with Getter Side-Effects, Timers »

XMLNodeList lacks any public constructor, XmlDocument.Create*() factory methods

The lack of a public constructor for XmlNodeList is a pain. It has a protected constructor. Would like NOT to always have to go through XPath to create a list. Its an abstract type, what are the concrete derived types? The answer is…

To create XmlNode, XmlElement, XmlAttribute objects, use the Create*() methods of XmlDocument.

Uset the OwnerDocument property to get at the document starting with a node.

XmlNode.Clone() makes a deep copy. How can the nodes be moved to a new document?

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)