XmlImplementation.CreateDocument Method

Definition

Creates a new XmlDocument.

public:
 virtual System::Xml::XmlDocument ^ CreateDocument();
public virtual System.Xml.XmlDocument CreateDocument ();
abstract member CreateDocument : unit -> System.Xml.XmlDocument
override this.CreateDocument : unit -> System.Xml.XmlDocument
Public Overridable Function CreateDocument () As XmlDocument

Returns

The new XmlDocument object.

Examples

The following example creates two XmlDocument objects from the same implementation.

XmlImplementation^ imp = gcnew XmlImplementation;
XmlDocument^ doc1 = imp->CreateDocument();
XmlDocument^ doc2 = imp->CreateDocument();
XmlImplementation imp = new XmlImplementation();
XmlDocument doc1 = imp.CreateDocument();
XmlDocument doc2 = imp.CreateDocument();
Dim imp As New XmlImplementation()
Dim doc1 As XmlDocument = imp.CreateDocument()
Dim doc2 As XmlDocument = imp.CreateDocument()

Remarks

XmlDocument objects created from the same implementation share the same name table. This enables users to compare attribute and element names between the objects more efficiently.

Although the XmlDocument objects share the same implementation, to move nodes from one document to another, you must use the ImportNode method.

Applies to

See also