XmlDocument.Implementation XmlDocument.Implementation XmlDocument.Implementation XmlDocument.Implementation Property

定義

取得目前文件的 XmlImplementation 物件。Gets the XmlImplementation object for the current document.

public:
 property System::Xml::XmlImplementation ^ Implementation { System::Xml::XmlImplementation ^ get(); };
public System.Xml.XmlImplementation Implementation { get; }
member this.Implementation : System.Xml.XmlImplementation
Public ReadOnly Property Implementation As XmlImplementation

屬性值

目前文件的 XmlImplementation 物件。The XmlImplementation object for the current document.

範例

下列範例會使用其他檔XmlDocument的執行方式, 建立新的。The following example creates a new XmlDocument using another document's implementation.

XmlDocument^ doc1 = gcnew XmlDocument;
doc1->Load( "books.xml" );
XmlDocument^ doc2 = doc1->Implementation->CreateDocument();
XmlDocument doc1 = new XmlDocument();
 doc1.Load("books.xml");
 XmlDocument doc2 = doc1.Implementation.CreateDocument();
Dim doc1 As New XmlDocument()
doc1.Load("books.xml")
Dim doc2 As XmlDocument = doc1.Implementation.CreateDocument()

備註

XmlDocument從相同XmlImplementation的共用建立的物件相同XmlNameTableXmlDocument objects created from the same XmlImplementation share the same XmlNameTable. 這可讓使用者將屬性和元素名稱與物件 (而非字串) 做比較。This allows users to compare attribute and element names as objects rather than strings.

雖然物件共用相同的執行, 但若要將節點從一個檔移到另一個, ImportNode您必須使用方法。 XmlDocumentAlthough the XmlDocument objects share the same implementation, to move nodes from one document to another you must use the ImportNode method.

適用於