|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
public interface DOMImplementation
DOMImplementation 介面為執行獨立於文檔物件模型的任何特定實例的操作提供了許多方法。
另請參見 Document Object Model (DOM) Level 3 Core Specification。
| 方法摘要 | |
|---|---|
Document |
createDocument(String namespaceURI,
String qualifiedName,
DocumentType doctype)
創建具有文檔元素的指定型別的 DOM Document 物件。 |
DocumentType |
createDocumentType(String qualifiedName,
String publicId,
String systemId)
創建空 DocumentType 節點。 |
Object |
getFeature(String feature,
String version)
此方法返回一個特定的物件,該物件實作了 DOM Features 中所指定的特定特性或版本的特殊 API。 |
boolean |
hasFeature(String feature,
String version)
測試 DOM 實作是否實作在 DOM Features 中指定的特定特性和版本。 |
| 方法詳細資訊 |
|---|
boolean hasFeature(String feature,
String version)
feature - 要測試的特性的名稱。version - 這是要測試的特性的版本號。
true;否則返回 false。
DocumentType createDocumentType(String qualifiedName,
String publicId,
String systemId)
throws DOMException
DocumentType 節點。無法使實體宣告和表示法可用。不發生實體參考擴展和預設屬性添加。
qualifiedName - 要創建的文檔型別的限定名稱。publicId - 外部子集的公共標識符。systemId - 外部子集的系統標識符。
null 的 Node.ownerDocument 的新 DocumentType 節點。
DOMException - INVALID_CHARACTER_ERR:如果指定的限定名稱不是遵循 [XML 1.0] 的 XML 名稱,則引發此異常。qualifiedName 是錯誤格式的,則引發此異常。
Document createDocument(String namespaceURI,
String qualifiedName,
DocumentType doctype)
throws DOMException
DocumentType 創建文檔,該實作可以實例化特定的 Document 物件,這些物件可支持 "Core" 之外的其他特性,如 "HTML" [DOM Level 2 HTML]。而在創建文檔之後再設置 DocumentType,可能使得此操作很難實作。此外,特定的 Document 創建方法(例如 createHTMLDocument [DOM Level 2 HTML])可用於獲取特定型別的 Document 物件。
namespaceURI - 要創建的文檔元素的名稱空間 URI 或 null。qualifiedName - 要創建的文檔元素的限定名稱或 null。doctype - 要創建的文檔的型別或 null。當 doctype 不是 null 時,其 Node.ownerDocument 屬性將被設置為正在創建的文檔。
Document 物件。如果 NamespaceURI、qualifiedName 和 doctype 為 null,則返回的 Document 為空的,不帶有文檔元素。
DOMException - INVALID_CHARACTER_ERR:如果指定的限定名稱不是遵循 [XML 1.0] 的 XML 名稱,則引發此異常。qualifiedName 是錯誤格式的;如果 qualifiedName 有前綴且 namespaceURI 為 null;或者如果 qualifiedName 為 null 且 namespaceURI 不同於 null;或者如果 qualifiedName 有名為 "xml" 的前綴且 namespaceURI 不同於 "http://www.w3.org/XML/1998/namespace" [XML Namespaces];或者如果 DOM 實作不支持 "XML" 功能但提供非 null 名稱空間 URI,因為名稱空間由 XML 定義。doctype 已經用於不同文檔或者從不同的實作創建,則引發此異常。
Object getFeature(String feature,
String version)
DOMImplementation 介面的特殊物件。
feature - 所請求的功能的名稱。注意,追加到功能的名稱的任何加號 "+" 將被忽略,因為它在此方法的上下文中無關緊要。version - 這是要測試的功能的版本號。
null。如果此方法返回的 DOMObject 實作 DOMImplementation 介面,則它必須委託給主要核心實作 DOMImplementation 且不返回與該主要核心 DOMImplementation 不一致的結果,如 hasFeature、getFeature、等等。
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。