All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class oracle.xml.parser.XMLParser

java.lang.Object
   |
   +----oracle.xml.parser.XMLParser

public class XMLParser
extends Object
implements Parser
This class implements an eXtensible Markup Language (XML) 1.0 parser according to the World Wide Web Consortium (W3C) recommendation.


Constructor Index

 o XMLParser()
Creates a new parser object.

Method Index

 o getDoctype()
Get the DTD
 o getDocument()
Gets the document
 o getReleaseVersion()
Returns the release version of the Oracle XML Parser
 o getValidationMode()
Returns the validation mode
 o parse(InputSource)
Parses the XML from given input source
 o parse(InputStream)
Parses the XML from given input stream.
 o parse(String)
Parses the XML from the URL indicated
 o parse(URL)
Parses the XML document pointed to by the given URL and creates the corresponding XML document hierarchy.
 o parseDTD(InputSource, String)
Parses the XML DTD from given input source
 o parseDTD(InputStream, String)
Parses the XML DTD from given input stream.
 o parseDTD(String, String)
Parses the XML DTD from the URL indicated
 o parseDTD(URL, String)
Parses the XML DTD pointed to by the given URL
 o setBaseURL(URL)
Set the base URL for loading external enitites and DTDs.
 o setDoctype(DTD)
Set the DTD
 o setDocumentHandler(DocumentHandler)
SAX applications can use this to register a new document event handler.
 o setDTDHandler(DTDHandler)
SAX applications can use this to register a new DTD event handler.
 o setEntityResolver(EntityResolver)
SAX applications can use this to register a new entity resolver
 o setErrorHandler(ErrorHandler)
SAX applications can use this to register a new error event handler.
 o setErrorStream(OutputStream)
Creates an output stream for the output of errors and warnings.
 o setErrorStream(OutputStream, String)
Creates an output stream for the output of errors and warnings.
 o setErrorStream(PrintWriter)
Creates an output stream for the output of errors and warnings.
 o setLocale(Locale)
SAX applications can use this to set the locale for error reporting.
 o setNodeFactory(NodeFactory)
Set the node factory.
 o setToken(int, boolean)
Applications can use this to register a new token for XML tokenizer.
 o setTokenHandler(XMLToken)
Applications can use this to register a new XML tokenizer event handler.
 o setValidationMode(boolean)
Set the validation mode
 o showWarnings(boolean)
Switch to determine whether to print warnings

Constructors

 o XMLParser
 public XMLParser()
Creates a new parser object.

Methods

 o parse
 public final void parse(InputSource in) throws XMLParseException, IOException
Parses the XML from given input source

Parameters:
in - the org.xml.sax.InputSouce to parse
Throws: XMLParseException
if syntax or other error encountered.
 o parse
 public final void parse(String in) throws XMLParseException, IOException
Parses the XML from the URL indicated

Parameters:
in - the String containing the URL to parse from
Throws: XMLParseException
if syntax or other error encountered.
 o parse
 public final void parse(URL url) throws XMLParseException, IOException
Parses the XML document pointed to by the given URL and creates the corresponding XML document hierarchy.

Parameters:
url - the url points to the XML document to parse.
Throws: XMLParseException
if syntax or other error encountered.
 o parse
 public final void parse(InputStream in) throws XMLParseException, IOException
Parses the XML from given input stream. The base URL should be set for resolving external entities and DTD.

Parameters:
in - the InputStream containing XML data to parse.
Throws: XMLParseException
if syntax or other error encountered.
See Also:
setBaseURL
 o parseDTD
 public final void parseDTD(InputSource in,
                            String rootName) throws XMLParseException, IOException
Parses the XML DTD from given input source

Parameters:
in - the org.xml.sax.InputSouce to parse
rootName - name of the root element
Throws: XMLParseException
if syntax or other error encountered.
 o parseDTD
 public final void parseDTD(String in,
                            String rootName) throws XMLParseException, IOException
Parses the XML DTD from the URL indicated

Parameters:
in - the String containing the URL to parse from
rootName - name of the root element
Throws: XMLParseException
if syntax or other error encountered.
 o parseDTD
 public final void parseDTD(URL url,
                            String rootName) throws XMLParseException, IOException
Parses the XML DTD pointed to by the given URL

Parameters:
url - the url points to the XML DTD to parse.
rootName - name of the root element
Throws: XMLParseException
if syntax or other error encountered.
 o parseDTD
 public final void parseDTD(InputStream in,
                            String rootName) throws XMLParseException, IOException
Parses the XML DTD from given input stream.

Parameters:
in - the InputStream containing XML DTD to parse.
rootName - name of the root element
Throws: XMLParseException
if syntax or other error encountered.
 o setErrorStream
 public final void setErrorStream(PrintWriter out)
Creates an output stream for the output of errors and warnings. If an output stream for errors is not specified, the parser will use the standard error output stream System.err for outputting errors and warnings.

Parameters:
out - The PrintWriter to use for errors and warnings
 o setErrorStream
 public final void setErrorStream(OutputStream out)
Creates an output stream for the output of errors and warnings. If an output stream for errors is not specified, the parser will use the standard error output stream System.err for outputting errors and warnings.

Parameters:
out - The output stream to use for errors and warnings
 o setErrorStream
 public final void setErrorStream(OutputStream out,
                                  String enc) throws IOException
Creates an output stream for the output of errors and warnings. If an output stream for errors is not specified, the parser will use the standard error output stream System.err for outputting errors and warnings. Additionally, an .exception is thrown if the encoding specified is unsupported.

Parameters:
out - The output stream to use for errors and warnings
enc - the encoding to use
Throws: IOException
if an unsupported encoding is specified
 o setLocale
 public void setLocale(Locale locale) throws SAXException
SAX applications can use this to set the locale for error reporting. Currently just throws an exception since the Oracle XML parser has no locale support.

Parameters:
locale - Locale to set
Throws: SAXException
A SAXException could be thrown.
See Also:
setLocale
 o setEntityResolver
 public void setEntityResolver(EntityResolver resolver)
SAX applications can use this to register a new entity resolver

Parameters:
resolver - EntityResolver being registered
See Also:
setEntityResolver, DTDHandler
 o setDTDHandler
 public void setDTDHandler(DTDHandler handler)
SAX applications can use this to register a new DTD event handler.

Parameters:
handler - DTDHandler being registered
See Also:
setDTDHandler, DTDHandler
 o setDocumentHandler
 public void setDocumentHandler(DocumentHandler handler)
SAX applications can use this to register a new document event handler.

Parameters:
handler - DocumentHandler being registered
See Also:
setDocumentHandler, DocumentHandler
 o setErrorHandler
 public void setErrorHandler(ErrorHandler handler)
SAX applications can use this to register a new error event handler. This replaces any previous setting for error handling.

Parameters:
handler - ErrorHandler being registered
See Also:
setErrorHandler, ErrorHandler
 o setTokenHandler
 public void setTokenHandler(XMLToken handler)
Applications can use this to register a new XML tokenizer event handler.

Parameters:
handler - XMLToken being registered
 o setToken
 public void setToken(int token,
                      boolean val)
Applications can use this to register a new token for XML tokenizer.

Parameters:
token - XMLToken being set
 o getDocument
 public XMLDocument getDocument()
Gets the document

Returns:
The document being parsed
 o setNodeFactory
 public void setNodeFactory(NodeFactory factory) throws XMLParseException
Set the node factory. Applications can extend the NodeFactory and register it through this method. The parser will then use the user supplied NodeFactory to create nodes of the DOM tree.

Parameters:
factory - The NodeFactory to set
See Also:
NodeFactory
 o setDoctype
 public void setDoctype(DTD dtd)
Set the DTD

Parameters:
dtd - DTD to set and used while parsing
 o getDoctype
 public DTD getDoctype()
Get the DTD

Returns:
The DTD
 o setValidationMode
 public void setValidationMode(boolean yes)
Set the validation mode

Parameters:
yes - determines whether the XML parser should be validating
 o setBaseURL
 public void setBaseURL(URL url)
Set the base URL for loading external enitites and DTDs. This method should to be called if the parse(InputStream) is used to parse the XML Document

Parameters:
url - The base URL
 o getValidationMode
 public boolean getValidationMode()
Returns the validation mode

Returns:
true if the XML parser is validating false if not
 o showWarnings
 public void showWarnings(boolean yes)
Switch to determine whether to print warnings

Parameters:
yes - determines whether warnings should be shown
 o getReleaseVersion
 public static String getReleaseVersion()
Returns the release version of the Oracle XML Parser

Returns:
the release version string

All Packages  Class Hierarchy  This Package  Previous  Next  Index