1 /*
   2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   3  *
   4  * This code is free software; you can redistribute it and/or modify it
   5  * under the terms of the GNU General Public License version 2 only, as
   6  * published by the Free Software Foundation.  Oracle designates this
   7  * particular file as subject to the "Classpath" exception as provided
   8  * by Oracle in the LICENSE file that accompanied this code.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 
  25 /*
  26  * This file is available under and governed by the GNU General Public
  27  * License version 2 only, as published by the Free Software Foundation.
  28  * However, the following notice accompanied the original version of this
  29  * file and, per its terms, should not be removed:
  30  *
  31  * Copyright (c) 2004 World Wide Web Consortium,
  32  *
  33  * (Massachusetts Institute of Technology, European Research Consortium for
  34  * Informatics and Mathematics, Keio University). All Rights Reserved. This
  35  * work is distributed under the W3C(r) Software License [1] in the hope that
  36  * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
  37  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  38  *
  39  * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
  40  */
  41 
  42 package org.w3c.dom;
  43 
  44 /**
  45  * Each <code>Document</code> has a <code>doctype</code> attribute whose value
  46  * is either <code>null</code> or a <code>DocumentType</code> object. The
  47  * <code>DocumentType</code> interface in the DOM Core provides an interface
  48  * to the list of entities that are defined for the document, and little
  49  * else because the effect of namespaces and the various XML schema efforts
  50  * on DTD representation are not clearly understood as of this writing.
  51  * <p>DOM Level 3 doesn't support editing <code>DocumentType</code> nodes.
  52  * <code>DocumentType</code> nodes are read-only.
  53  * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
  54  */
  55 public interface DocumentType extends Node {
  56     /**
  57      * The name of DTD; i.e., the name immediately following the
  58      * <code>DOCTYPE</code> keyword.
  59      */
  60     public String getName();
  61 
  62     /**
  63      * A <code>NamedNodeMap</code> containing the general entities, both
  64      * external and internal, declared in the DTD. Parameter entities are
  65      * not contained. Duplicates are discarded. For example in:
  66      * <pre>&lt;!DOCTYPE
  67      * ex SYSTEM "ex.dtd" [ &lt;!ENTITY foo "foo"&gt; &lt;!ENTITY bar
  68      * "bar"&gt; &lt;!ENTITY bar "bar2"&gt; &lt;!ENTITY % baz "baz"&gt;
  69      * ]&gt; &lt;ex/&gt;</pre>
  70      *  the interface provides access to <code>foo</code>
  71      * and the first declaration of <code>bar</code> but not the second
  72      * declaration of <code>bar</code> or <code>baz</code>. Every node in
  73      * this map also implements the <code>Entity</code> interface.
  74      * <br>The DOM Level 2 does not support editing entities, therefore
  75      * <code>entities</code> cannot be altered in any way.
  76      */
  77     public NamedNodeMap getEntities();
  78 
  79     /**
  80      * A <code>NamedNodeMap</code> containing the notations declared in the
  81      * DTD. Duplicates are discarded. Every node in this map also implements
  82      * the <code>Notation</code> interface.
  83      * <br>The DOM Level 2 does not support editing notations, therefore
  84      * <code>notations</code> cannot be altered in any way.
  85      */
  86     public NamedNodeMap getNotations();
  87 
  88     /**
  89      * The public identifier of the external subset.
  90      * @since 1.4, DOM Level 2
  91      */
  92     public String getPublicId();
  93 
  94     /**
  95      * The system identifier of the external subset. This may be an absolute
  96      * URI or not.
  97      * @since 1.4, DOM Level 2
  98      */
  99     public String getSystemId();
 100 
 101     /**
 102      * The internal subset as a string, or <code>null</code> if there is none.
 103      * This is does not contain the delimiting square brackets.
 104      * <p ><b>Note:</b> The actual content returned depends on how much
 105      * information is available to the implementation. This may vary
 106      * depending on various parameters, including the XML processor used to
 107      * build the document.
 108      * @since 1.4, DOM Level 2
 109      */
 110     public String getInternalSubset();
 111 
 112 }