gnu.xml.aelfred2
Class SAXDriver
java.lang.Object
|
+--gnu.xml.aelfred2.SAXDriver
All Implemented Interfaces:
Locator, Attributes2, XMLReader, Parser, AttributeList
An enhanced SAX2 version of Microstar's Ælfred XML parser.
The enhancements primarily relate to significant improvements in
conformance to the XML specification, and SAX2 support. Performance
has been improved. See the package level documentation for more
information.
Name |
Notes |
Features ... URL prefix is
http://xml.org/sax/features/ |
(URL)/external-general-entities |
Value defaults to true |
(URL)/external-parameter-entities |
Value defaults to true |
(URL)/is-standalone |
(PRELIMINARY) Returns true iff the document's parsing
has started (some non-error event after startDocument()
was reported) and the document's standalone flag is set. |
(URL)/namespace-prefixes |
Value defaults to false (but XML 1.0 names are
always reported) |
(URL)/lexical-handler/parameter-entities |
Value is fixed at true |
(URL)/namespaces |
Value defaults to true |
(URL)/resolve-dtd-uris |
(PRELIMINARY) Value defaults to true |
(URL)/string-interning |
Value is fixed at true |
(URL)/use-attributes2 |
(PRELIMINARY) Value is fixed at true |
(URL)/use-entity-resolver2 |
(PRELIMINARY) Value defaults to true |
(URL)/validation |
Value is fixed at false |
Handler Properties ... URL prefix is
http://xml.org/sax/properties/ |
(URL)/declaration-handler |
A declaration handler may be provided. |
(URL)/lexical-handler |
A lexical handler may be provided. |
This parser currently implements the SAX1 Parser API, but
it may not continue to do so in the future.
Authors:- Written by David Megginson (version 1.2a from Microstar)
- Updated by David Brownell <dbrownell@users.sourceforge.net>
See Also:
SAXDriver
public SAXDriver()
Constructs a SAX Parser.
getColumnNumber
public int getColumnNumber()
SAX Locator method (don't invoke on parser);
getContentHandler
public ContentHandler getContentHandler()
SAX2: Returns the object used to report the logical
content of an XML document.
getDTDHandler
public DTDHandler getDTDHandler()
SAX2: Returns the object used to process declarations related
to notations and unparsed entities.
getEntityResolver
public EntityResolver getEntityResolver()
SAX2: Returns the object used when resolving external
entities during parsing (both general and parameter entities).
getErrorHandler
public ErrorHandler getErrorHandler()
SAX2: Returns the object used to receive callbacks for XML
errors of all levels (fatal, nonfatal, warning); this is never null;
getFeature
public boolean getFeature(java.lang.String featureId)
SAX2: Tells the value of the specified feature flag.
Parameters:
Throws:
getIndex
public int getIndex(java.lang.String xmlName)
SAX2 Attributes method (don't invoke on parser);
Parameters:
getIndex
public int getIndex(java.lang.String uri, java.lang.String local)
SAX2 Attributes method (don't invoke on parser);
Parameters:
getLength
public int getLength()
SAX1 AttributeList, SAX2 Attributes method
(don't invoke on parser);
getLineNumber
public int getLineNumber()
SAX Locator method (don't invoke on parser);
getLocalName
public String getLocalName(int index)
SAX2 Attributes method (don't invoke on parser);
Parameters:
getName
public String getName(int i)
SAX1 AttributeList method (don't invoke on parser);
Parameters:
getProperty
public Object getProperty(java.lang.String propertyId)
SAX2: Returns the specified property.
Parameters:
Throws:
getPublicId
public String getPublicId()
SAX Locator method (don't invoke on parser);
getQName
public String getQName(int i)
SAX2 Attributes method (don't invoke on parser);
Parameters:
getSystemId
public String getSystemId()
SAX Locator method (don't invoke on parser);
getType
public String getType(int i)
SAX1 AttributeList, SAX2 Attributes method
(don't invoke on parser);
Parameters:
getType
public String getType(java.lang.String xmlName)
SAX1 AttributeList, SAX2 Attributes method
(don't invoke on parser);
Parameters:
getType
public String getType(java.lang.String uri, java.lang.String local)
SAX2 Attributes method (don't invoke on parser);
Parameters:
getURI
public String getURI(int index)
SAX2 Attributes method (don't invoke on parser);
Parameters:
getValue
public String getValue(int i)
SAX1 AttributeList, SAX2 Attributes method
(don't invoke on parser);
Parameters:
getValue
public String getValue(java.lang.String xmlName)
SAX1 AttributeList, SAX2 Attributes method
(don't invoke on parser);
Parameters:
getValue
public String getValue(java.lang.String uri, java.lang.String local)
SAX Attributes method (don't invoke on parser);
Parameters:
isDeclared
public boolean isDeclared(int index)
Parameters:
Returns:
- false unless the attribute was declared in the DTD.
Throws:
isDeclared
public boolean isDeclared(java.lang.String qName)
Parameters:
Returns:
- false unless the attribute was declared in the DTD.
Throws:
isDeclared
public boolean isDeclared(java.lang.String uri, java.lang.String localName)
Parameters:
Returns:
- false unless the attribute was declared in the DTD.
Throws:
isSpecified
public boolean isSpecified(int index)
SAX-ext Attributes2 method (don't invoke on parser);
Parameters:
isSpecified
public boolean isSpecified(java.lang.String xmlName)
SAX-ext Attributes2 method (don't invoke on parser);
Parameters:
isSpecified
public boolean isSpecified(java.lang.String uri, java.lang.String local)
SAX-ext Attributes2 method (don't invoke on parser);
Parameters:
parse
public void parse(java.lang.String systemId)
SAX1, SAX2: Preferred API to parse an XML document, using a
system identifier (URI).
Parameters:
parse
public void parse(org.xml.sax.InputSource source)
SAX1, SAX2: Auxiliary API to parse an XML document, used mostly
when no URI is available.
If you want anything useful to happen, you should set
at least one type of handler.
Parameters:
Throws:
SAXException
- The handlers may throw any SAXException,
and the parser normally throws SAXParseException objects.IOException
- IOExceptions are normally through through
the parser if there are problems reading the source document.
See Also:
setContentHandler
public void setContentHandler(org.xml.sax.ContentHandler handler)
SAX2: Assigns the object used to report the logical
content of an XML document. If a document handler was set,
this content handler will supplant it (but XML 1.0 style name
reporting may remain enabled).
Parameters:
setDTDHandler
public void setDTDHandler(org.xml.sax.DTDHandler handler)
SAX1, SAX2: Set the DTD handler for this parser.
Parameters:
setDocumentHandler
public void setDocumentHandler(org.xml.sax.DocumentHandler handler)
SAX1: Set the document handler for this parser. If a
content handler was set, this document handler will supplant it.
The parser is set to report all XML 1.0 names rather than to
filter out "xmlns" attributes (the "namespace-prefixes" feature
is set to true).
Parameters:
setEntityResolver
public void setEntityResolver(org.xml.sax.EntityResolver resolver)
SAX1, SAX2: Set the entity resolver for this parser.
Parameters:
setErrorHandler
public void setErrorHandler(org.xml.sax.ErrorHandler handler)
SAX1, SAX2: Set the error handler for this parser.
Parameters:
setFeature
public void setFeature(java.lang.String featureId, boolean value)
SAX2: Sets the state of feature flags in this parser. Some
built-in feature flags are mutable.
Parameters:
setLocale
public void setLocale(java.util.Locale locale)
SAX1: Sets the locale used for diagnostics; currently,
only locales using the English language are supported.
Parameters:
setProperty
public void setProperty(java.lang.String propertyId, java.lang.Object value)
SAX2: Assigns the specified property. Like SAX1 handlers,
these may be changed at any time.
Parameters:
This parser currently implements the SAX1 Parser API, but it may not continue to do so in the future.