001/* 002 * Copyright (c) 2000 World Wide Web Consortium, 003 * (Massachusetts Institute of Technology, Institut National de 004 * Recherche en Informatique et en Automatique, Keio University). All 005 * Rights Reserved. This program is distributed under the W3C's Software 006 * Intellectual Property License. This program is distributed in the 007 * hope that it will be useful, but WITHOUT ANY WARRANTY; without even 008 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 009 * PURPOSE. 010 * See W3C License http://www.w3.org/Consortium/Legal/ for more details. 011 */ 012 013package org.w3c.dom; 014 015/** 016 * The <code>DOMImplementation</code> interface provides a number of methods 017 * for performing operations that are independent of any particular instance 018 * of the document object model. 019 * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>. 020 */ 021public interface DOMImplementation { 022 /** 023 * Test if the DOM implementation implements a specific feature. 024 * @param featureThe name of the feature to test (case-insensitive). The 025 * values used by DOM features are defined throughout the DOM Level 2 026 * specifications and listed in the section. The name must be an XML 027 * name. To avoid possible conflicts, as a convention, names referring 028 * to features defined outside the DOM specification should be made 029 * unique by reversing the name of the Internet domain name of the 030 * person (or the organization that the person belongs to) who defines 031 * the feature, component by component, and using this as a prefix. 032 * For instance, the W3C SVG Working Group defines the feature 033 * "org.w3c.dom.svg". 034 * @param versionThis is the version number of the feature to test. In 035 * Level 2, the string can be either "2.0" or "1.0". If the version is 036 * not specified, supporting any version of the feature causes the 037 * method to return <code>true</code>. 038 * @return <code>true</code> if the feature is implemented in the 039 * specified version, <code>false</code> otherwise. 040 */ 041 public boolean hasFeature(String feature, 042 String version); 043 044 /** 045 * Creates an empty <code>DocumentType</code> node. Entity declarations 046 * and notations are not made available. Entity reference expansions and 047 * default attribute additions do not occur. It is expected that a 048 * future version of the DOM will provide a way for populating a 049 * <code>DocumentType</code>. 050 * <br>HTML-only DOM implementations do not need to implement this method. 051 * @param qualifiedNameThe qualified name of the document type to be 052 * created. 053 * @param publicIdThe external subset public identifier. 054 * @param systemIdThe external subset system identifier. 055 * @return A new <code>DocumentType</code> node with 056 * <code>Node.ownerDocument</code> set to <code>null</code>. 057 * @exception DOMException 058 * INVALID_CHARACTER_ERR: Raised if the specified qualified name 059 * contains an illegal character. 060 * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 061 * malformed. 062 * @since DOM Level 2 063 */ 064 public DocumentType createDocumentType(String qualifiedName, 065 String publicId, 066 String systemId) 067 throws DOMException; 068 069 /** 070 * Creates an XML <code>Document</code> object of the specified type with 071 * its document element. HTML-only DOM implementations do not need to 072 * implement this method. 073 * @param namespaceURIThe namespace URI of the document element to create. 074 * @param qualifiedNameThe qualified name of the document element to be 075 * created. 076 * @param doctypeThe type of document to be created or <code>null</code>. 077 * When <code>doctype</code> is not <code>null</code>, its 078 * <code>Node.ownerDocument</code> attribute is set to the document 079 * being created. 080 * @return A new <code>Document</code> object. 081 * @exception DOMException 082 * INVALID_CHARACTER_ERR: Raised if the specified qualified name 083 * contains an illegal character. 084 * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 085 * malformed, if the <code>qualifiedName</code> has a prefix and the 086 * <code>namespaceURI</code> is <code>null</code>, or if the 087 * <code>qualifiedName</code> has a prefix that is "xml" and the 088 * <code>namespaceURI</code> is different from " 089 * http://www.w3.org/XML/1998/namespace" . 090 * <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already 091 * been used with a different document or was created from a different 092 * implementation. 093 * @since DOM Level 2 094 */ 095 public Document createDocument(String namespaceURI, 096 String qualifiedName, 097 DocumentType doctype) 098 throws DOMException; 099 100}