public interface DeclHandler
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.
这是SAX2提供更完全的信息在一个XML文档的DTD声明一个可选的扩展处理程序。XML的读者不需要承认这个处理程序,它不属于核心SAX2分布。
注意,数据相关的DTD声明(未分析实体和符号)已经通过DTDHandler
接口报道。
如果您使用的是报关处理与词汇的处理,所有的事件将startDTD
和endDTD
事件之间发生。
为一个XML阅读器设置declhandler,使用属性名称http://xml.org/sax/properties/declaration-handler
和实现此接口的对象的setProperty
方法(或零)的价值。如果读者不报告声明的事件,它将SAXNotRecognizedException
当你试图登记处理程序。
Modifier and Type | Method and Description |
---|---|
void |
attributeDecl(String eName, String aName, String type, String mode, String value)
报表属性类型声明。
|
void |
elementDecl(String name, String model)
报告元素类型声明。
|
void |
externalEntityDecl(String name, String publicId, String systemId)
报告已解析的外部实体声明。
|
void |
internalEntityDecl(String name, String value)
报告内部实体声明。
|
void elementDecl(String name, String model) throws SAXException
内容模型包含字符串“空”,字符串“任何”,或一个圆括号组,后跟一个指标发生。该模型将归一化后,所有参数实体完全解决所有的空格去掉,并将包括圆括号。其他正常化(如删除多余的括号或简化的发生指标)是在自由裁量权的解析器。
name
-元素类型的名称。
model
-内容模型作为正常化的字符串。
SAXException
-应用程序可能会引发一个异常。
void attributeDecl(String eName, String aName, String type, String mode, String value) throws SAXException
只有有效的(第一)声明的属性将被报告。类型将一个字符串“我”、“本我”、“象征”、“IDREFS”、“象征”、“这些”、“实体”,“实体”,一个括号标记组与分离器”|”和所有的空格去掉,或“符号”后面的空间中的所有空格去掉括号标记组。
该值将是报告的应用程序的值,适当地规范化,并与实体和字符引用扩展。
eName
-相关的元素的名称。
aName
-属性的名称。
type
-一个字符串类型的属性。
mode
-一个字符串属性默认模式(“#暗示”、“#要求”,或“#固定”)或空如果没有这些应用。
value
-一个字符串属性的默认值为空,或者如果没有。
SAXException
-应用程序可能会引发一个异常。
void internalEntityDecl(String name, String value) throws SAXException
只有有效的(第一)声明为每个实体将被报告。在值中的所有参数实体将被扩展,但一般实体将不会被扩展。
name
-单位名称。如果它是一个参数实体,名称将以“%”开始。
value
-实体替换文本。
SAXException
-应用程序可能会引发一个异常。
externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
,
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
void externalEntityDecl(String name, String publicId, String systemId) throws SAXException
只有有效的(第一)声明为每个实体将被报告。
如果系统标识符是一个链接,解析器必须完全解析它,才将它传递给应用程序。
name
-单位名称。如果它是一个参数实体,名称将以“%”开始。
publicId
-实体的公共标识符,或空如果没有了。
systemId
-实体的系统标识符。
SAXException
-应用程序可能会引发一个异常。
internalEntityDecl(java.lang.String, java.lang.String)
,
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
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.