public interface DTDHandler
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
如果一个SAX应用程序需要的符号和未分析实体的信息,然后应用程序实现这个接口和寄存器实例使用解析器的setdtdhandler方法SAX解析器。解析器应用实例报告符号和未解析的实体声明的应用。
注意,这个接口只包括那些事件的XML DTD推荐需要处理器报告:符号和未分析实体声明。
SAX解析器可以以任何顺序报告这些事件,无论为这些符号和未分析实体被宣布;然而,所有事件必须报道的DTD文档处理程序是StartDocument事件后,与前不同的事件。(如果LexicalHandler
使用,这些事件也必须之前报道的enddtd事件。)
它是由应用程序存储的信息,为未来使用(也许在一个哈希表或对象树)。如果应用程序遇到类型“符号”、“实体”或“实体”的属性,它可以使用通过这个接口获得的信息来查找与属性值对应的实体和/或符号。
XMLReader.setDTDHandler(org.xml.sax.DTDHandler)
void notationDecl(String name, String publicId, String systemId) throws SAXException
它是由以供以后参考,符号记录应用程序的必要;符号可能出现的属性值和未分析实体声明和有时被用于处理指令的目标名称。
在systemid publicid和至少一个必须是非空。如果一个系统标识符,它是一个URL,SAX解析器必须充分之前将其传递给应用程序通过这一事件解决。
没有保证的符号声明将报道过任何未分析实体使用它。
name
-符号名称。
publicId
-符号的公共标识符,或空如果没有了。
systemId
-符号的系统标识符,或空如果没有了。
SAXException
-萨克斯例外,可能是包装的另一个例外。
unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
,
Attributes
void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException
注意符号名称对应于一个符号的notationDecl
事件报道。它是由以供以后参考,实体记录应用程序的必要;未分析实体可能出现的属性值。
如果系统标识符是一个链接,解析器必须完全解析它,才将它传递给应用程序。
name
-未分析实体的名称。
publicId
-实体的公共标识符,或空如果没有了。
systemId
-实体的系统标识符。
notationName
-相关的符号名称。
SAXException
-萨克斯例外,可能是包装的另一个例外。
notationDecl(java.lang.String, java.lang.String, java.lang.String)
,
Attributes
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.