共用方式為


IDOMImplementation.CreateDocument(String, String, IDocumentType) 方法

定義

建立具有其文件專案之指定型別的 DOM Document 物件。

[Android.Runtime.Register("createDocument", "(Ljava/lang/String;Ljava/lang/String;Lorg/w3c/dom/DocumentType;)Lorg/w3c/dom/Document;", "GetCreateDocument_Ljava_lang_String_Ljava_lang_String_Lorg_w3c_dom_DocumentType_Handler:Org.W3c.Dom.IDOMImplementationInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Org.W3c.Dom.IDocument? CreateDocument (string? namespaceURI, string? qualifiedName, Org.W3c.Dom.IDocumentType? doctype);
[<Android.Runtime.Register("createDocument", "(Ljava/lang/String;Ljava/lang/String;Lorg/w3c/dom/DocumentType;)Lorg/w3c/dom/Document;", "GetCreateDocument_Ljava_lang_String_Ljava_lang_String_Lorg_w3c_dom_DocumentType_Handler:Org.W3c.Dom.IDOMImplementationInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member CreateDocument : string * string * Org.W3c.Dom.IDocumentType -> Org.W3c.Dom.IDocument

參數

namespaceURI
String

要建立 或 null之文件專案的命名空間 URI。

qualifiedName
String

要建立或 null的文件專案限定名稱。

doctype
IDocumentType

要建立或 null的文件類型。 當 不是 nulldoctype,其 Node.ownerDocument 屬性會設定為正在建立的檔。

傳回

具有其文件專案的新 Document 物件。 NamespaceURI如果 、 qualifiedNamedoctypenull,則傳Document回的 是空的,沒有檔案元素。

屬性

例外狀況

INVALID_CHARACTER_ERR:如果指定的限定名稱不是根據 [] 的 XML 名稱,則引發。
NAMESPACE_ERR:如果 格式不正確,則引發;如果 qualifiedNamequalifiedName 具有前置詞,namespaceURInull且 為 ,或 nullnamespaceURIqualifiedName 是 和 不同,或者 如果 具有 “xml” namespaceURI 且 的前置詞與 “” [] 不同nullqualifiedName,或 DOM 實作不支援"XML"此功能,但提供非 Null 命名空間 URI,則為 ,因為命名空間是由 XML 所定義。
WRONG_DOCUMENT_ERR:如果 doctype 已經搭配不同的檔使用,或是從不同的實作建立,則引發。
NOT_SUPPORTED_ERR:如果實作不支援功能 「XML」,而且透過文件公開的語言不支援 XML 命名空間(例如 []),可能會引發。

備註

建立具有其文件專案之指定型別的 DOM Document 物件。 <br>請注意,根據 DocumentType 指定的 來建立檔,實作可能會具現化支援 “Core” 其他功能的特殊 Document 物件,例如 “HTML” [DOM Level 2 HTML] 。 另一方面,在建立文件之後設定 DocumentType ,就不太可能發生這種情況。 或者,特殊 Document 化建立方法,例如 createHTMLDocument [DOM 層級 2 HTML] ,可用來取得特定類型的 Document 物件。

已在 DOM 層級 2 中新增。

org.w3c.dom.DOMImplementation.createDocument(java.lang.String, java.lang.String, org.w3c.dom.DocumentType)Java 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於