|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.icl.saxon.aelfred.XmlParser
Parse XML documents and return parse events through call-backs.
Use the SAXDriver
class as your entry point, as the
internal parser interfaces are subject to change.
SAXDriver
Inner Class Summary | |
(package private) static class |
XmlParser.EncodingException
|
Field Summary | |
static int |
ATTRIBUTE_CDATA
Constant: the attribute value is a string value. |
static int |
ATTRIBUTE_DEFAULT_FIXED
Constant: the attribute was declared #FIXED. |
static int |
ATTRIBUTE_DEFAULT_IMPLIED
Constant: the attribute was declared #IMPLIED. |
static int |
ATTRIBUTE_DEFAULT_REQUIRED
Constant: the attribute was declared #REQUIRED. |
static int |
ATTRIBUTE_DEFAULT_SPECIFIED
Constant: the attribute has a literal default value specified. |
static int |
ATTRIBUTE_DEFAULT_UNDECLARED
Constant: the attribute is not declared. |
static int |
ATTRIBUTE_ENTITIES
Constant: the attribute value is a list of entity names. |
static int |
ATTRIBUTE_ENTITY
Constant: the attribute value is the name of an entity. |
static int |
ATTRIBUTE_ENUMERATED
Constant: the attribute value is a token from an enumeration. |
static int |
ATTRIBUTE_ID
Constant: the attribute value is a unique identifier. |
static int |
ATTRIBUTE_IDREF
Constant: the attribute value is a reference to a unique identifier. |
static int |
ATTRIBUTE_IDREFS
Constant: the attribute value is a list of ID references. |
static int |
ATTRIBUTE_NMTOKEN
Constant: the attribute value is a name token. |
static int |
ATTRIBUTE_NMTOKENS
Constant: the attribute value is a list of name tokens. |
static int |
ATTRIBUTE_NOTATION
Constant: the attribute is the name of a notation. |
static int |
ATTRIBUTE_UNDECLARED
Constant: the attribute has not been declared for this element type. |
static int |
CONTENT_ANY
Constant: the element has a content model of ANY. |
static int |
CONTENT_ELEMENTS
Constant: the element has element content. |
static int |
CONTENT_EMPTY
Constant: the element has declared content of EMPTY. |
static int |
CONTENT_MIXED
Constant: the element has mixed content. |
static int |
CONTENT_UNDECLARED
Constant: an element has not been declared. |
static int |
ENTITY_INTERNAL
Constant: the entity is internal. |
static int |
ENTITY_NDATA
Constant: the entity is external, non-parseable data. |
static int |
ENTITY_TEXT
Constant: the entity is external XML data. |
static int |
ENTITY_UNDECLARED
Constant: the entity has not been declared. |
Constructor Summary | |
(package private) |
XmlParser()
Construct a new parser with no associated handler. |
Method Summary | |
(package private) static void |
|
java.util.Enumeration |
declaredAttributes(java.lang.String elname)
Get the declared attributes for an element type. |
java.util.Enumeration |
declaredElements()
Get the declared elements for an XML document. |
java.util.Enumeration |
declaredEntities()
Get declared entities. |
java.util.Enumeration |
declaredNotations()
Get declared notations. |
(package private) void |
doParse(java.lang.String systemId,
java.lang.String publicId,
java.io.Reader reader,
java.io.InputStream stream,
java.lang.String encoding)
Parse an XML document from the character stream, byte stream, or URI that you provide (in that order of preference). |
java.lang.String |
getAttributeDefaultValue(java.lang.String name,
java.lang.String aname)
Retrieve the default value of a declared attribute. |
int |
getAttributeDefaultValueType(java.lang.String name,
java.lang.String aname)
Retrieve the default value type of a declared attribute. |
java.lang.String |
getAttributeEnumeration(java.lang.String name,
java.lang.String aname)
Retrieve the allowed values for an enumerated attribute type. |
java.lang.String |
getAttributeExpandedValue(java.lang.String name,
java.lang.String aname)
Retrieve the expanded value of a declared attribute. |
int |
getAttributeType(java.lang.String name,
java.lang.String aname)
Retrieve the declared type of an attribute. |
int |
getColumnNumber()
Return the current column number. |
java.lang.String |
getElementContentModel(java.lang.String name)
Look up the content model of an element. |
int |
getElementContentType(java.lang.String name)
Look up the content type of an element. |
java.lang.String |
getEntityNotationName(java.lang.String eName)
Get the notation name associated with an NDATA entity. |
java.lang.String |
getEntityPublicId(java.lang.String ename)
Return an external entity's public identifier, if any. |
java.lang.String |
getEntitySystemId(java.lang.String ename)
Return an external entity's system identifier. |
int |
getEntityType(java.lang.String ename)
Find the type of an entity. |
java.lang.String |
getEntityValue(java.lang.String ename)
Return the value of an internal entity. |
int |
getLineNumber()
Return the current line number. |
java.lang.String |
getNotationPublicId(java.lang.String nname)
Look up the public identifier for a notation. |
java.lang.String |
getNotationSystemId(java.lang.String nname)
Look up the system identifier for a notation. |
java.lang.String |
intern(char[] ch,
int start,
int length)
Create an interned string from a character array. |
(package private) void |
setHandler(SAXDriver handler)
Set the handler that will receive parsing events. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int CONTENT_UNDECLARED
getElementContentType(java.lang.String)
public static final int CONTENT_ANY
getElementContentType(java.lang.String)
public static final int CONTENT_EMPTY
getElementContentType(java.lang.String)
public static final int CONTENT_MIXED
getElementContentType(java.lang.String)
public static final int CONTENT_ELEMENTS
getElementContentType(java.lang.String)
public static final int ENTITY_UNDECLARED
getEntityType(java.lang.String)
public static final int ENTITY_INTERNAL
getEntityType(java.lang.String)
public static final int ENTITY_NDATA
getEntityType(java.lang.String)
public static final int ENTITY_TEXT
getEntityType(java.lang.String)
public static final int ATTRIBUTE_UNDECLARED
getAttributeType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_CDATA
getAttributeType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_ID
getAttributeType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_IDREF
getAttributeType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_IDREFS
getAttributeType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_ENTITY
getAttributeType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_ENTITIES
getAttributeType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_NMTOKEN
getAttributeType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_NMTOKENS
getAttributeType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_ENUMERATED
getAttributeType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_NOTATION
getAttributeType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_DEFAULT_UNDECLARED
getAttributeDefaultValueType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_DEFAULT_SPECIFIED
getAttributeDefaultValueType(java.lang.String, java.lang.String)
,
getAttributeDefaultValue(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_DEFAULT_IMPLIED
getAttributeDefaultValueType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_DEFAULT_REQUIRED
getAttributeDefaultValueType(java.lang.String, java.lang.String)
public static final int ATTRIBUTE_DEFAULT_FIXED
getAttributeDefaultValueType(java.lang.String, java.lang.String)
,
getAttributeDefaultValue(java.lang.String, java.lang.String)
Constructor Detail |
XmlParser()
setHandler(com.icl.saxon.aelfred.SAXDriver)
,
#parse
Method Detail |
void setHandler(SAXDriver handler)
handler
- The handler to receive callback events.#parse
void doParse(java.lang.String systemId, java.lang.String publicId, java.io.Reader reader, java.io.InputStream stream, java.lang.String encoding) throws java.lang.Exception
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.java.lang.Exception
- Basically SAXException or IOExceptionstatic void()
public java.lang.String intern(char[] ch, int start, int length)
==
instead of String.equals ()
.
This is much more efficient than constructing a non-interned string first, and then interning it.
ch
- an array of characters for building the string.start
- the starting position in the array.length
- the number of characters to place in the string.(String)
,
String.intern()
public java.util.Enumeration declaredElements()
The results will be valid only after the DTD (if any) has been parsed.
getElementContentType(java.lang.String)
,
getElementContentModel(java.lang.String)
public int getElementContentType(java.lang.String name)
name
- The element type name.getElementContentModel(java.lang.String)
,
CONTENT_UNDECLARED
,
CONTENT_ANY
,
CONTENT_EMPTY
,
CONTENT_MIXED
,
CONTENT_ELEMENTS
public java.lang.String getElementContentModel(java.lang.String name)
The result will always be null unless the content type is CONTENT_ELEMENTS or CONTENT_MIXED.
name
- The element type name.getElementContentType(java.lang.String)
public java.util.Enumeration declaredAttributes(java.lang.String elname)
elname
- The name of the element type.getAttributeType(java.lang.String, java.lang.String)
,
getAttributeEnumeration(java.lang.String, java.lang.String)
,
getAttributeDefaultValueType(java.lang.String, java.lang.String)
,
getAttributeDefaultValue(java.lang.String, java.lang.String)
,
getAttributeExpandedValue(java.lang.String, java.lang.String)
public int getAttributeType(java.lang.String name, java.lang.String aname)
name
- The name of the associated element.aname
- The name of the attribute.ATTRIBUTE_UNDECLARED
,
ATTRIBUTE_CDATA
,
ATTRIBUTE_ID
,
ATTRIBUTE_IDREF
,
ATTRIBUTE_IDREFS
,
ATTRIBUTE_ENTITY
,
ATTRIBUTE_ENTITIES
,
ATTRIBUTE_NMTOKEN
,
ATTRIBUTE_NMTOKENS
,
ATTRIBUTE_ENUMERATED
,
ATTRIBUTE_NOTATION
public java.lang.String getAttributeEnumeration(java.lang.String name, java.lang.String aname)
name
- The name of the associated element.aname
- The name of the attribute.ATTRIBUTE_ENUMERATED
,
ATTRIBUTE_NOTATION
public java.lang.String getAttributeDefaultValue(java.lang.String name, java.lang.String aname)
name
- The name of the associated element.aname
- The name of the attribute.getAttributeExpandedValue(java.lang.String, java.lang.String)
public java.lang.String getAttributeExpandedValue(java.lang.String name, java.lang.String aname) throws java.lang.Exception
General entities (and char refs) will be expanded (once).
name
- The name of the associated element.aname
- The name of the attribute.getAttributeDefaultValue(java.lang.String, java.lang.String)
public int getAttributeDefaultValueType(java.lang.String name, java.lang.String aname)
ATTRIBUTE_DEFAULT_SPECIFIED
,
ATTRIBUTE_DEFAULT_IMPLIED
,
ATTRIBUTE_DEFAULT_REQUIRED
,
ATTRIBUTE_DEFAULT_FIXED
public java.util.Enumeration declaredEntities()
getEntityType(java.lang.String)
,
getEntityPublicId(java.lang.String)
,
getEntitySystemId(java.lang.String)
,
getEntityValue(java.lang.String)
,
getEntityNotationName(java.lang.String)
public int getEntityType(java.lang.String ename)
ENTITY_UNDECLARED
,
ENTITY_INTERNAL
,
ENTITY_NDATA
,
ENTITY_TEXT
public java.lang.String getEntityPublicId(java.lang.String ename)
ename
- The name of the external entity.getEntityType(java.lang.String)
public java.lang.String getEntitySystemId(java.lang.String ename)
ename
- The name of the external entity.getEntityType(java.lang.String)
public java.lang.String getEntityValue(java.lang.String ename)
ename
- The name of the internal entity.getEntityType(java.lang.String)
public java.lang.String getEntityNotationName(java.lang.String eName)
ename
- The NDATA entity name.getEntityType(java.lang.String)
public java.util.Enumeration declaredNotations()
getNotationPublicId(java.lang.String)
,
getNotationSystemId(java.lang.String)
public java.lang.String getNotationPublicId(java.lang.String nname)
nname
- The name of the notation.getNotationSystemId(java.lang.String)
public java.lang.String getNotationSystemId(java.lang.String nname)
nname
- The name of the notation.getNotationPublicId(java.lang.String)
public int getLineNumber()
public int getColumnNumber()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |