01: /*
02: * Copyright (c) 2000 World Wide Web Consortium,
03: * (Massachusetts Institute of Technology, Institut National de
04: * Recherche en Informatique et en Automatique, Keio University). All
05: * Rights Reserved. This program is distributed under the W3C's Software
06: * Intellectual Property License. This program is distributed in the
07: * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
08: * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
09: * PURPOSE.
10: * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
11: */
12:
13: package org.w3c.dom;
14:
15: /**
16: * The <code>DOMImplementation</code> interface provides a number of methods
17: * for performing operations that are independent of any particular instance
18: * of the document object model.
19: * <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>.
20: */
21: public interface DOMImplementation {
22: /**
23: * Test if the DOM implementation implements a specific feature.
24: * @param featureThe name of the feature to test (case-insensitive). The
25: * values used by DOM features are defined throughout the DOM Level 2
26: * specifications and listed in the section. The name must be an XML
27: * name. To avoid possible conflicts, as a convention, names referring
28: * to features defined outside the DOM specification should be made
29: * unique by reversing the name of the Internet domain name of the
30: * person (or the organization that the person belongs to) who defines
31: * the feature, component by component, and using this as a prefix.
32: * For instance, the W3C SVG Working Group defines the feature
33: * "org.w3c.dom.svg".
34: * @param versionThis is the version number of the feature to test. In
35: * Level 2, the string can be either "2.0" or "1.0". If the version is
36: * not specified, supporting any version of the feature causes the
37: * method to return <code>true</code>.
38: * @return <code>true</code> if the feature is implemented in the
39: * specified version, <code>false</code> otherwise.
40: */
41: public boolean hasFeature(String feature, String version);
42:
43: /**
44: * Creates an empty <code>DocumentType</code> node. Entity declarations
45: * and notations are not made available. Entity reference expansions and
46: * default attribute additions do not occur. It is expected that a
47: * future version of the DOM will provide a way for populating a
48: * <code>DocumentType</code>.
49: * <br>HTML-only DOM implementations do not need to implement this method.
50: * @param qualifiedNameThe qualified name of the document type to be
51: * created.
52: * @param publicIdThe external subset public identifier.
53: * @param systemIdThe external subset system identifier.
54: * @return A new <code>DocumentType</code> node with
55: * <code>Node.ownerDocument</code> set to <code>null</code>.
56: * @exception DOMException
57: * INVALID_CHARACTER_ERR: Raised if the specified qualified name
58: * contains an illegal character.
59: * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
60: * malformed.
61: * @since DOM Level 2
62: */
63: public DocumentType createDocumentType(String qualifiedName,
64: String publicId, String systemId) throws DOMException;
65:
66: /**
67: * Creates an XML <code>Document</code> object of the specified type with
68: * its document element. HTML-only DOM implementations do not need to
69: * implement this method.
70: * @param namespaceURIThe namespace URI of the document element to create.
71: * @param qualifiedNameThe qualified name of the document element to be
72: * created.
73: * @param doctypeThe type of document to be created or <code>null</code>.
74: * When <code>doctype</code> is not <code>null</code>, its
75: * <code>Node.ownerDocument</code> attribute is set to the document
76: * being created.
77: * @return A new <code>Document</code> object.
78: * @exception DOMException
79: * INVALID_CHARACTER_ERR: Raised if the specified qualified name
80: * contains an illegal character.
81: * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
82: * malformed, if the <code>qualifiedName</code> has a prefix and the
83: * <code>namespaceURI</code> is <code>null</code>, or if the
84: * <code>qualifiedName</code> has a prefix that is "xml" and the
85: * <code>namespaceURI</code> is different from "
86: * http://www.w3.org/XML/1998/namespace" .
87: * <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
88: * been used with a different document or was created from a different
89: * implementation.
90: * @since DOM Level 2
91: */
92: public Document createDocument(String namespaceURI,
93: String qualifiedName, DocumentType doctype)
94: throws DOMException;
95:
96: }
|