1. /*
  2. * Copyright (c) 2000 World Wide Web Consortium,
  3. * (Massachusetts Institute of Technology, Institut National de
  4. * Recherche en Informatique et en Automatique, Keio University). All
  5. * Rights Reserved. This program is distributed under the W3C's Software
  6. * Intellectual Property License. This program is distributed in the
  7. * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  8. * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  9. * PURPOSE.
  10. * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  11. */
  12. package org.w3c.dom;
  13. /**
  14. * The <code>DOMImplementation</code> interface provides a number of methods
  15. * for performing operations that are independent of any particular instance
  16. * of the document object model.
  17. * <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>.
  18. */
  19. public interface DOMImplementation {
  20. /**
  21. * Test if the DOM implementation implements a specific feature.
  22. * @param feature The name of the feature to test (case-insensitive). The
  23. * values used by DOM features are defined throughout the DOM Level 2
  24. * specifications and listed in the section. The name must be an XML
  25. * name. To avoid possible conflicts, as a convention, names referring
  26. * to features defined outside the DOM specification should be made
  27. * unique.
  28. * @param version This is the version number of the feature to test. In
  29. * Level 2, the string can be either "2.0" or "1.0". If the version is
  30. * not specified, supporting any version of the feature causes the
  31. * method to return <code>true</code>.
  32. * @return <code>true</code> if the feature is implemented in the
  33. * specified version, <code>false</code> otherwise.
  34. */
  35. public boolean hasFeature(String feature,
  36. String version);
  37. /**
  38. * Creates an empty <code>DocumentType</code> node. Entity declarations
  39. * and notations are not made available. Entity reference expansions and
  40. * default attribute additions do not occur. It is expected that a
  41. * future version of the DOM will provide a way for populating a
  42. * <code>DocumentType</code>.
  43. * @param qualifiedName The qualified name of the document type to be
  44. * created.
  45. * @param publicId The external subset public identifier.
  46. * @param systemId The external subset system identifier.
  47. * @return A new <code>DocumentType</code> node with
  48. * <code>Node.ownerDocument</code> set to <code>null</code>.
  49. * @exception DOMException
  50. * INVALID_CHARACTER_ERR: Raised if the specified qualified name
  51. * contains an illegal character.
  52. * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
  53. * malformed.
  54. * <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
  55. * not support the <code>"XML"</code> feature, if they choose not to
  56. * support this method. Other features introduced in the future, by
  57. * the DOM WG or in extensions defined by other groups, may also
  58. * demand support for this method; please consult the definition of
  59. * the feature to see if it requires this method.
  60. * @since DOM Level 2
  61. */
  62. public DocumentType createDocumentType(String qualifiedName,
  63. String publicId,
  64. String systemId)
  65. throws DOMException;
  66. /**
  67. * Creates a DOM Document object of the specified type with its document
  68. * element.
  69. * @param namespaceURI The namespace URI of the document element to
  70. * create.
  71. * @param qualifiedName The qualified name of the document element to be
  72. * created.
  73. * @param doctype The 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" , or if the DOM
  87. * implementation does not support the <code>"XML"</code> feature but
  88. * a non-null namespace URI was provided, since namespaces were
  89. * defined by XML.
  90. * <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
  91. * been used with a different document or was created from a different
  92. * implementation.
  93. * <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
  94. * not support the "XML" feature, if they choose not to support this
  95. * method. Other features introduced in the future, by the DOM WG or
  96. * in extensions defined by other groups, may also demand support for
  97. * this method; please consult the definition of the feature to see if
  98. * it requires this method.
  99. * @since DOM Level 2
  100. */
  101. public Document createDocument(String namespaceURI,
  102. String qualifiedName,
  103. DocumentType doctype)
  104. throws DOMException;
  105. }