ATTRIBUTE_CDATA
public static final int ATTRIBUTE_CDATA
Constant: the attribute value is a string value.
ATTRIBUTE_DEFAULT_FIXED
public static final int ATTRIBUTE_DEFAULT_FIXED
Constant: the attribute was declared #FIXED.
ATTRIBUTE_DEFAULT_IMPLIED
public static final int ATTRIBUTE_DEFAULT_IMPLIED
Constant: the attribute was declared #IMPLIED.
ATTRIBUTE_DEFAULT_REQUIRED
public static final int ATTRIBUTE_DEFAULT_REQUIRED
Constant: the attribute was declared #REQUIRED.
ATTRIBUTE_DEFAULT_SPECIFIED
public static final int ATTRIBUTE_DEFAULT_SPECIFIED
Constant: the attribute has a literal default value specified.
ATTRIBUTE_DEFAULT_UNDECLARED
public static final int ATTRIBUTE_DEFAULT_UNDECLARED
Constant: the attribute is not declared.
ATTRIBUTE_ENTITIES
public static final int ATTRIBUTE_ENTITIES
Constant: the attribute value is a list of entity names.
ATTRIBUTE_ENTITY
public static final int ATTRIBUTE_ENTITY
Constant: the attribute value is the name of an entity.
ATTRIBUTE_ENUMERATED
public static final int ATTRIBUTE_ENUMERATED
Constant: the attribute value is a token from an enumeration.
ATTRIBUTE_ID
public static final int ATTRIBUTE_ID
Constant: the attribute value is a unique identifier.
ATTRIBUTE_IDREF
public static final int ATTRIBUTE_IDREF
Constant: the attribute value is a reference to a unique identifier.
ATTRIBUTE_IDREFS
public static final int ATTRIBUTE_IDREFS
Constant: the attribute value is a list of ID references.
ATTRIBUTE_NMTOKEN
public static final int ATTRIBUTE_NMTOKEN
Constant: the attribute value is a name token.
ATTRIBUTE_NMTOKENS
public static final int ATTRIBUTE_NMTOKENS
Constant: the attribute value is a list of name tokens.
ATTRIBUTE_NOTATION
public static final int ATTRIBUTE_NOTATION
Constant: the attribute is the name of a notation.
ATTRIBUTE_UNDECLARED
public static final int ATTRIBUTE_UNDECLARED
Constant: the attribute has not been declared for this element type.
CONTENT_ANY
public static final int CONTENT_ANY
Constant: the element has a content model of ANY.
CONTENT_ELEMENTS
public static final int CONTENT_ELEMENTS
Constant: the element has element content.
CONTENT_EMPTY
public static final int CONTENT_EMPTY
Constant: the element has declared content of EMPTY.
CONTENT_MIXED
public static final int CONTENT_MIXED
Constant: the element has mixed content.
CONTENT_UNDECLARED
public static final int CONTENT_UNDECLARED
Constant: an element has not been declared.
ENTITY_INTERNAL
public static final int ENTITY_INTERNAL
Constant: the entity is internal.
ENTITY_NDATA
public static final int ENTITY_NDATA
Constant: the entity is external, non-parseable data.
ENTITY_TEXT
public static final int ENTITY_TEXT
Constant: the entity is external XML data.
ENTITY_UNDECLARED
public static final int ENTITY_UNDECLARED
Constant: the entity has not been declared.
declaredAttributes
public Enumeration declaredAttributes(String elname)
Get the declared attributes for an element type.
elname
- The name of the element type.
- An Enumeration of all the attributes declared for
a specific element type. The results will be valid only
after the DTD (if any) has been parsed.
declaredElements
public Enumeration declaredElements()
Get the declared elements for an XML document.
The results will be valid only after the DTD (if any) has been
parsed.
- An enumeration of all element types declared for this
document (as Strings).
declaredEntities
public Enumeration declaredEntities()
Get declared entities.
- An Enumeration of all the entities declared for
this XML document. The results will be valid only
after the DTD (if any) has been parsed.
declaredNotations
public Enumeration declaredNotations()
Get declared notations.
- An Enumeration of all the notations declared for
this XML document. The results will be valid only
after the DTD (if any) has been parsed.
doParse
(package private) void doParse(String systemId,
String publicId,
Reader reader,
InputStream stream,
String encoding)
throws Exception
Parse an XML document from the character stream, byte stream, or URI
that you provide (in that order of preference). Any URI that you
supply will become the base URI for resolving relative URI, and may
be used to acquire a reader or byte stream.
You may parse more than one document, but that must be done
sequentially. Only one thread at a time may use this parser.
systemId
- The URI of the document; should never be null,
but may be so iff a reader or a stream is provided.publicId
- The public identifier of the document, or null.reader
- A character stream; must be null if stream isn't.stream
- A byte input stream; must be null if reader isn't.encoding
- The suggested encoding, or null if unknown.
getAttributeDefaultValue
public String getAttributeDefaultValue(String name,
String aname)
Retrieve the default value of a declared attribute.
name
- The name of the associated element.aname
- The name of the attribute.
- The default value, or null if the attribute was
#IMPLIED or simply undeclared and unspecified.
getAttributeDefaultValueType
public int getAttributeDefaultValueType(String name,
String aname)
Retrieve the default value type of a declared attribute.
getAttributeEnumeration
public String getAttributeEnumeration(String name,
String aname)
Retrieve the allowed values for an enumerated attribute type.
name
- The name of the associated element.aname
- The name of the attribute.
- A string containing the token list.
getAttributeExpandedValue
public String getAttributeExpandedValue(String name,
String aname)
throws Exception
Retrieve the expanded value of a declared attribute.
General entities (and char refs) will be expanded (once).
name
- The name of the associated element.aname
- The name of the attribute.
- The expanded default value, or null if the attribute was
#IMPLIED or simply undeclared
getAttributeType
public int getAttributeType(String name,
String aname)
Retrieve the declared type of an attribute.
name
- The name of the associated element.aname
- The name of the attribute.
- An integer constant representing the attribute type.
ATTRIBUTE_UNDECLARED
, ATTRIBUTE_CDATA
, ATTRIBUTE_ID
, ATTRIBUTE_IDREF
, ATTRIBUTE_IDREFS
, ATTRIBUTE_ENTITY
, ATTRIBUTE_ENTITIES
, ATTRIBUTE_NMTOKEN
, ATTRIBUTE_NMTOKENS
, ATTRIBUTE_ENUMERATED
, ATTRIBUTE_NOTATION
getColumnNumber
public int getColumnNumber()
Return the current column number.
getElementContentModel
public String getElementContentModel(String name)
Look up the content model of an element.
The result will always be null unless the content type is
CONTENT_ELEMENTS or CONTENT_MIXED.
name
- The element type name.
- The normalised content model, as a string.
getElementContentType
public int getElementContentType(String name)
Look up the content type of an element.
name
- The element type name.
- An integer constant representing the content type.
getEntityNotationName
public String getEntityNotationName(String eName)
Get the notation name associated with an NDATA entity.
- The associated notation name, or null if the
entity was not declared, or if it is not an
NDATA entity.
getEntityPublicId
public String getEntityPublicId(String ename)
Return an external entity's public identifier, if any.
ename
- The name of the external entity.
- The entity's system identifier, or null if the
entity was not declared, if it is not an
external entity, or if no public identifier was
provided.
getEntitySystemId
public String getEntitySystemId(String ename)
Return an external entity's system identifier.
ename
- The name of the external entity.
- The entity's system identifier, or null if the
entity was not declared, or if it is not an
external entity. Change made by MHK: The system identifier
is returned as an absolute URL, resolved relative to the entity
it was contained in.
getEntityType
public int getEntityType(String ename)
Find the type of an entity.
getEntityValue
public String getEntityValue(String ename)
Return the value of an internal entity.
ename
- The name of the internal entity.
- The entity's value, or null if the entity was
not declared, or if it is not an internal entity.
getLineNumber
public int getLineNumber()
Return the current line number.
getNotationPublicId
public String getNotationPublicId(String nname)
Look up the public identifier for a notation.
You will normally use this method to look up a notation
that was provided as an attribute value or for an NDATA entity.
nname
- The name of the notation.
- A string containing the public identifier, or null
if none was provided or if no such notation was
declared.
getNotationSystemId
public String getNotationSystemId(String nname)
Look up the system identifier for a notation.
You will normally use this method to look up a notation
that was provided as an attribute value or for an NDATA entity.
nname
- The name of the notation.
- A string containing the system identifier, or null
if no such notation was declared.
intern
public String intern(ch[] ,
int start,
int length)
Create an interned string from a character array.
Ælfred uses this method to create an interned version
of all names and name tokens, so that it can test equality
with
==
instead of
String.equals ()
.
This is much more efficient than constructing a non-interned
string first, and then interning it.
start
- the starting position in the array.length
- the number of characters to place in the string.
setHandler
(package private) void setHandler(SAXDriver handler)
Set the handler that will receive parsing events.
handler
- The handler to receive callback events.