Adding/Creating an XmlNode without an XmlDocument

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I see plenty of examples of adding a new XmlNode where the XmlDocument is available to create that node. I was wondering how do that without an XmlDocument to use as a factory? Since XmlNode is abstract I cannot simply create one with new I need to call
the factory methods CreateNode or CreateElement. Whatever the solution I am assuming will work for XmlAttribute to replace the CreateAttribute factory method. The base that I am adding to is an XmlElement. It has a property OwnerDocument. Can
I be assured that this property will always be non-null and valid?
Thank you. <hr class="sig Kevin Burton

View the full article
 
Back
Top