All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class oracle.xml.parser.v2.DOMParser

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

public class DOMParser
extends XMLParser
implements XMLConstants
This class implements an eXtensible Markup Language (XML) 1.0 parser according to the World Wide Web Consortium (W3C) recommendation. to parse a XML document and build a DOM tree.


Constructor Index

 o DOMParser()
Creates a new parser object.

Method Index

 o getDoctype()
Get the DTD
 o getDocument()
Gets the document
 o parseDTD(InputSource, String)
Parses the XML External DTD from given input source
 o parseDTD(InputStream, String)
Parses the XML External DTD from given input stream.
 o parseDTD(Reader, String)
Parses the XML External DTD from given input stream.
 o parseDTD(String, String)
Parses the XML External DTD from the URL indicated
 o parseDTD(URL, String)
Parses the XML External DTD document pointed to by the given URL and creates the corresponding XML document hierarchy.
 o setDebugMode(boolean)
Sets a flag to turn on debug information in the document
 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 setNodeFactory(NodeFactory)
Set the node factory.
 o showWarnings(boolean)
Switch to determine whether to print warnings

Constructors

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

Methods

 o setErrorStream
 public final void setErrorStream(PrintWriter out) 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.

Parameters:
out - The PrintWriter to use for errors and warnings
 o setErrorStream
 public final void setErrorStream(OutputStream out) 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.

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 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
Throws: XMLParseException
if an invalid factory is set
See Also:
NodeFactory
 o getDoctype
 public DTD getDoctype()
Get the DTD

Returns:
The DTD
 o showWarnings
 public void showWarnings(boolean yes)
Switch to determine whether to print warnings

Parameters:
yes - determines whether warnings should be shown
 o setDebugMode
 public void setDebugMode(boolean flag)
Sets a flag to turn on debug information in the document

Parameters:
flag - determines whether debug info is stored
 o parseDTD
 public final void parseDTD(InputSource in,
                            String rootName) throws XMLParseException, SAXException, IOException
Parses the XML External DTD from given input source

Parameters:
in - the org.xml.sax.InputSouce to parse
rootName - the element to be used as root Element
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
 o parseDTD
 public final void parseDTD(String in,
                            String rootName) throws XMLParseException, SAXException, IOException
Parses the XML External DTD from the URL indicated

Parameters:
in - the String containing the URL to parse from
rootName - the element to be used as root Element
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
 o parseDTD
 public final void parseDTD(URL url,
                            String rootName) throws XMLParseException, SAXException, IOException
Parses the XML External DTD 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.
rootName - the element to be used as root Element
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
 o parseDTD
 public final void parseDTD(InputStream in,
                            String rootName) throws XMLParseException, SAXException, IOException
Parses the XML External DTD 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.
rootName - the element to be used as root Element
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
See Also:
setBaseURL
 o parseDTD
 public final void parseDTD(Reader r,
                            String rootName) throws XMLParseException, SAXException, IOException
Parses the XML External DTD from given input stream. The base URL should be set for resolving external entities and DTD.

Parameters:
r - the Reader containing XML data to parse.
rootName - the element to be used as root Element
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
See Also:
setBaseURL

All Packages  Class Hierarchy  This Package  Previous  Next  Index