001/* 002 * Copyright (c) 2004 World Wide Web Consortium, 003 * 004 * (Massachusetts Institute of Technology, European Research Consortium for 005 * Informatics and Mathematics, Keio University). All Rights Reserved. This 006 * work is distributed under the W3C(r) Software License [1] in the hope that 007 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 008 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 009 * 010 * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 011 */ 012 013package org.w3c.dom; 014 015/** 016 * Each <code>Document</code> has a <code>doctype</code> attribute whose value 017 * is either <code>null</code> or a <code>DocumentType</code> object. The 018 * <code>DocumentType</code> interface in the DOM Core provides an interface 019 * to the list of entities that are defined for the document, and little 020 * else because the effect of namespaces and the various XML schema efforts 021 * on DTD representation are not clearly understood as of this writing. 022 * <p>DOM Level 3 doesn't support editing <code>DocumentType</code> nodes. 023 * <code>DocumentType</code> nodes are read-only. 024 * <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>. 025 */ 026public interface DocumentType extends Node { 027 /** 028 * The name of DTD; i.e., the name immediately following the 029 * <code>DOCTYPE</code> keyword. 030 */ 031 public String getName(); 032 033 /** 034 * A <code>NamedNodeMap</code> containing the general entities, both 035 * external and internal, declared in the DTD. Parameter entities are 036 * not contained. Duplicates are discarded. For example in: 037 * <pre><!DOCTYPE 038 * ex SYSTEM "ex.dtd" [ <!ENTITY foo "foo"> <!ENTITY bar 039 * "bar"> <!ENTITY bar "bar2"> <!ENTITY % baz "baz"> 040 * ]> <ex/></pre> 041 * the interface provides access to <code>foo</code> 042 * and the first declaration of <code>bar</code> but not the second 043 * declaration of <code>bar</code> or <code>baz</code>. Every node in 044 * this map also implements the <code>Entity</code> interface. 045 * <br>The DOM Level 2 does not support editing entities, therefore 046 * <code>entities</code> cannot be altered in any way. 047 */ 048 public NamedNodeMap getEntities(); 049 050 /** 051 * A <code>NamedNodeMap</code> containing the notations declared in the 052 * DTD. Duplicates are discarded. Every node in this map also implements 053 * the <code>Notation</code> interface. 054 * <br>The DOM Level 2 does not support editing notations, therefore 055 * <code>notations</code> cannot be altered in any way. 056 */ 057 public NamedNodeMap getNotations(); 058 059 /** 060 * The public identifier of the external subset. 061 * @since DOM Level 2 062 */ 063 public String getPublicId(); 064 065 /** 066 * The system identifier of the external subset. This may be an absolute 067 * URI or not. 068 * @since DOM Level 2 069 */ 070 public String getSystemId(); 071 072 /** 073 * The internal subset as a string, or <code>null</code> if there is none. 074 * This is does not contain the delimiting square brackets. 075 * <p ><b>Note:</b> The actual content returned depends on how much 076 * information is available to the implementation. This may vary 077 * depending on various parameters, including the XML processor used to 078 * build the document. 079 * @since DOM Level 2 080 */ 081 public String getInternalSubset(); 082 083}