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.
-
DOMParser()
- Creates a new parser object.
-
getDoctype()
- Get the DTD
-
getDocument()
- Gets the document
-
parseDTD(InputSource, String)
- Parses the XML External DTD from given input source
-
parseDTD(InputStream, String)
- Parses the XML External DTD from given input stream.
-
parseDTD(Reader, String)
- Parses the XML External DTD from given input stream.
-
parseDTD(String, String)
- Parses the XML External DTD from the URL indicated
-
parseDTD(URL, String)
- Parses the XML External DTD document pointed to by the given URL and
creates the corresponding XML document hierarchy.
-
setDebugMode(boolean)
-
Sets a flag to turn on debug information in the document
-
setErrorStream(OutputStream)
- Creates an output stream for the output of errors and warnings.
-
setErrorStream(OutputStream, String)
- Creates an output stream for the output of errors and warnings.
-
setErrorStream(PrintWriter)
- Creates an output stream for the output of errors and warnings.
-
setNodeFactory(NodeFactory)
- Set the node factory.
-
showWarnings(boolean)
-
Switch to determine whether to print warnings
DOMParser
public DOMParser()
- Creates a new parser object.
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
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
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
getDocument
public XMLDocument getDocument()
- Gets the document
- Returns:
- The document being parsed
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
getDoctype
public DTD getDoctype()
- Get the DTD
- Returns:
- The
DTD
showWarnings
public void showWarnings(boolean yes)
- Switch to determine whether to print warnings
- Parameters:
- yes - determines whether warnings should be shown
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
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.
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.
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.
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
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