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:
013: package 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: */
021: public interface DOMImplementation {
022: /**
023: * Test if the DOM implementation implements a specific feature.
024: * @param feature The 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.
030: * @param version This is the version number of the feature to test. In
031: * Level 2, the string can be either "2.0" or "1.0". If the version is
032: * not specified, supporting any version of the feature causes the
033: * method to return <code>true</code>.
034: * @return <code>true</code> if the feature is implemented in the
035: * specified version, <code>false</code> otherwise.
036: */
037: public boolean hasFeature(String feature, String version);
038:
039: /**
040: * Creates an empty <code>DocumentType</code> node. Entity declarations
041: * and notations are not made available. Entity reference expansions and
042: * default attribute additions do not occur. It is expected that a
043: * future version of the DOM will provide a way for populating a
044: * <code>DocumentType</code>.
045: * @param qualifiedName The qualified name of the document type to be
046: * created.
047: * @param publicId The external subset public identifier.
048: * @param systemId The external subset system identifier.
049: * @return A new <code>DocumentType</code> node with
050: * <code>Node.ownerDocument</code> set to <code>null</code>.
051: * @exception DOMException
052: * INVALID_CHARACTER_ERR: Raised if the specified qualified name
053: * contains an illegal character.
054: * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
055: * malformed.
056: * <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
057: * not support the <code>"XML"</code> feature, if they choose not to
058: * support this method. Other features introduced in the future, by
059: * the DOM WG or in extensions defined by other groups, may also
060: * demand support for this method; please consult the definition of
061: * the feature to see if it requires this method.
062: * @since DOM Level 2
063: */
064: public DocumentType createDocumentType(String qualifiedName,
065: String publicId, String systemId) throws DOMException;
066:
067: /**
068: * Creates a DOM Document object of the specified type with its document
069: * element.
070: * @param namespaceURI The namespace URI of the document element to
071: * create.
072: * @param qualifiedName The qualified name of the document element to be
073: * created.
074: * @param doctype The type of document to be created or <code>null</code>.
075: * When <code>doctype</code> is not <code>null</code>, its
076: * <code>Node.ownerDocument</code> attribute is set to the document
077: * being created.
078: * @return A new <code>Document</code> object.
079: * @exception DOMException
080: * INVALID_CHARACTER_ERR: Raised if the specified qualified name
081: * contains an illegal character.
082: * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
083: * malformed, if the <code>qualifiedName</code> has a prefix and the
084: * <code>namespaceURI</code> is <code>null</code>, or if the
085: * <code>qualifiedName</code> has a prefix that is "xml" and the
086: * <code>namespaceURI</code> is different from "
087: * http://www.w3.org/XML/1998/namespace" , or if the DOM
088: * implementation does not support the <code>"XML"</code> feature but
089: * a non-null namespace URI was provided, since namespaces were
090: * defined by XML.
091: * <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
092: * been used with a different document or was created from a different
093: * implementation.
094: * <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
095: * not support the "XML" feature, if they choose not to support this
096: * method. Other features introduced in the future, by the DOM WG or
097: * in extensions defined by other groups, may also demand support for
098: * this method; please consult the definition of the feature to see if
099: * it requires this method.
100: * @since DOM Level 2
101: */
102: public Document createDocument(String namespaceURI,
103: String qualifiedName, DocumentType doctype)
104: throws DOMException;
105:
106: }
|