public class DTDParser
extends java.lang.Object
This conforms to the portion of the XML 1.0 specification related to the external DTD subset.
For multi-language applications (such as web servers using XML processing to create dynamic content), a method supports choosing a locale for parser diagnostics which is both understood by the message recipient and supported by the parser.
This parser produces a stream of parse events. It supports some features (exposing comments, CDATA sections, and entity references) which are not required to be reported by conformant XML processors.
Modifier and Type | Field | Description |
---|---|---|
protected java.util.Set |
declaredElements |
|
static java.lang.String |
TYPE_CDATA |
|
static java.lang.String |
TYPE_ENTITIES |
|
static java.lang.String |
TYPE_ENTITY |
|
static java.lang.String |
TYPE_ENUMERATION |
|
static java.lang.String |
TYPE_ID |
|
static java.lang.String |
TYPE_IDREF |
|
static java.lang.String |
TYPE_IDREFS |
|
static java.lang.String |
TYPE_NMTOKEN |
|
static java.lang.String |
TYPE_NMTOKENS |
|
static java.lang.String |
TYPE_NOTATION |
Constructor | Description |
---|---|
DTDParser() |
Modifier and Type | Method | Description |
---|---|---|
java.util.Locale |
chooseLocale(java.lang.String[] languages) |
Chooses a client locale to use for diagnostics, using the first language
specified in the list that is supported by this parser.
|
int |
getColumnNumber() |
|
DTDEventListener |
getDtdHandler() |
Returns the handler used to for DTD parsing events.
|
org.xml.sax.EntityResolver |
getEntityResolver() |
Returns the object used to resolve entities
|
int |
getLineNumber() |
|
java.util.Locale |
getLocale() |
Returns the diagnostic locale.
|
java.lang.String |
getPublicId() |
|
java.lang.String |
getSystemId() |
|
void |
parse(java.lang.String uri) |
Parse a DTD.
|
void |
parse(org.xml.sax.InputSource in) |
Parse a DTD.
|
void |
setDtdHandler(DTDEventListener handler) |
Used by applications to set handling of DTD parsing events.
|
void |
setEntityResolver(org.xml.sax.EntityResolver r) |
Lets applications control entity resolution.
|
void |
setLocale(java.util.Locale l) |
Used by applications to request locale for diagnostics.
|
public static final java.lang.String TYPE_CDATA
public static final java.lang.String TYPE_ID
public static final java.lang.String TYPE_IDREF
public static final java.lang.String TYPE_IDREFS
public static final java.lang.String TYPE_ENTITY
public static final java.lang.String TYPE_ENTITIES
public static final java.lang.String TYPE_NMTOKEN
public static final java.lang.String TYPE_NMTOKENS
public static final java.lang.String TYPE_NOTATION
public static final java.lang.String TYPE_ENUMERATION
protected final java.util.Set declaredElements
public void setLocale(java.util.Locale l) throws org.xml.sax.SAXException
l
- The locale to use, or null to use system defaults (which may
include only message IDs).org.xml.sax.SAXException
public java.util.Locale getLocale()
public java.util.Locale chooseLocale(java.lang.String[] languages) throws org.xml.sax.SAXException
languages
- Array of language specifiers, ordered with the most
preferable one at the front. For example, "en-ca" then "fr-ca", followed
by "zh_CN". Both RFC 1766 and Java styles are supported.org.xml.sax.SAXException
MessageCatalog
public void setEntityResolver(org.xml.sax.EntityResolver r)
public org.xml.sax.EntityResolver getEntityResolver()
public void setDtdHandler(DTDEventListener handler)
public DTDEventListener getDtdHandler()
public void parse(org.xml.sax.InputSource in) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public void parse(java.lang.String uri) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public java.lang.String getPublicId()
public java.lang.String getSystemId()
public int getLineNumber()
public int getColumnNumber()
Copyright © 2018 Oracle Corporation. All rights reserved.