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.
-
XMLParser()
- Creates a new parser object.
-
getDoctype()
- Get the DTD
-
getDocument()
- Gets the document
-
getReleaseVersion()
- Returns the release version of the Oracle XML Parser
-
getValidationMode()
- Returns the validation mode
-
parse(InputSource)
- Parses the XML from given input source
-
parse(InputStream)
- Parses the XML from given input stream.
-
parse(String)
- Parses the XML from the URL indicated
-
parse(URL)
- Parses the XML document pointed to by the given URL and
creates the corresponding XML document hierarchy.
-
parseDTD(InputSource, String)
- Parses the XML DTD from given input source
-
parseDTD(InputStream, String)
- Parses the XML DTD from given input stream.
-
parseDTD(String, String)
- Parses the XML DTD from the URL indicated
-
parseDTD(URL, String)
- Parses the XML DTD pointed to by the given URL
-
setBaseURL(URL)
-
Set the base URL for loading external enitites and DTDs.
-
setDoctype(DTD)
- Set the DTD
-
setDocumentHandler(DocumentHandler)
- SAX applications can use this to register a new document event handler.
-
setDTDHandler(DTDHandler)
- SAX applications can use this to register a new DTD event handler.
-
setEntityResolver(EntityResolver)
- SAX applications can use this to register a new entity resolver
-
setErrorHandler(ErrorHandler)
- SAX applications can use this to register a new error event handler.
-
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.
-
setLocale(Locale)
- SAX applications can use this to set the locale for error reporting.
-
setNodeFactory(NodeFactory)
- Set the node factory.
-
setToken(int, boolean)
- Applications can use this to register a new token for XML tokenizer.
-
setTokenHandler(XMLToken)
- Applications can use this to register a new XML tokenizer event handler.
-
setValidationMode(boolean)
-
Set the validation mode
-
showWarnings(boolean)
-
Switch to determine whether to print warnings
XMLParser
public XMLParser()
- Creates a new parser object.
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.
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.
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.
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
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.
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.
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.
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.
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
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
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
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
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
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
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
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
setTokenHandler
public void setTokenHandler(XMLToken handler)
- Applications can use this to register a new XML tokenizer event handler.
- Parameters:
- handler -
XMLToken
being registered
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
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
- See Also:
- NodeFactory
setDoctype
public void setDoctype(DTD dtd)
- Set the DTD
- Parameters:
- dtd -
DTD
to set and used while parsing
getDoctype
public DTD getDoctype()
- Get the DTD
- Returns:
- The
DTD
setValidationMode
public void setValidationMode(boolean yes)
- Set the validation mode
- Parameters:
- yes - determines whether the XML parser should be validating
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
getValidationMode
public boolean getValidationMode()
- Returns the validation mode
- Returns:
-
true
if the XML parser is validating
false
if not
showWarnings
public void showWarnings(boolean yes)
- Switch to determine whether to print warnings
- Parameters:
- yes - determines whether warnings should be shown
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