All Packages Class Hierarchy This Package Previous Next Index
Class oracle.xml.parser.v2.XMLParser
java.lang.Object
|
+----oracle.xml.parser.v2.XMLParser
- public abstract class XMLParser
- extends Object
- implements XMLConstants
This class serves as a base class for the DOMParser
and SAXParser
classes. It contains methods to parse
eXtensible Markup Language (XML) 1.0 documents according to the
World Wide Web Consortium (W3C)
recommendation.
This class can not be instantiated (applications may use the DOM or
SAX parser depending on their requirements).
-
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(Reader)
- 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.
-
setBaseURL(URL)
-
Set the base URL for loading external enitites and DTDs.
-
setDoctype(DTD)
- Set the DTD
-
setLocale(Locale)
- Applications can use this to set the locale for error reporting.
-
setPreserveWhitespace(boolean)
-
Set the white space preserving mode
-
setSchemaValidationMode(boolean)
-
Set the schema validation mode
-
setValidationMode(boolean)
-
Set the validation mode
parse
public final void parse(InputSource in) throws XMLParseException, SAXException, 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.
- Throws: SAXException
- Any SAX exception, possibly
wrapping another exception.
- Throws: IOException
- IO Error.
parse
public final void parse(String in) throws XMLParseException, SAXException, 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.
- Throws: SAXException
- Any SAX exception, possibly
wrapping another exception.
- Throws: IOException
- IO Error.
parse
public final void parse(URL url) throws XMLParseException, SAXException, 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.
- Throws: SAXException
- Any SAX exception, possibly
wrapping another exception.
- Throws: IOException
- IO Error.
parse
public final void parse(InputStream in) throws XMLParseException, SAXException, 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.
- Throws: SAXException
- Any SAX exception, possibly
wrapping another exception.
- Throws: IOException
- IO Error.
- See Also:
- setBaseURL
parse
public final void parse(Reader r) throws XMLParseException, SAXException, IOException
- Parses the XML 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.
- Throws: XMLParseException
- if syntax or other error encountered.
- Throws: SAXException
- Any SAX exception, possibly
wrapping another exception.
- Throws: IOException
- IO Error.
- See Also:
- setBaseURL
setLocale
public void setLocale(Locale locale) throws SAXException
- Applications can use this to set the locale for error reporting.
- Parameters:
- locale -
Locale
to set
- Throws: SAXException
- A
SAXException
could be thrown.
- See Also:
- setLocale
setDoctype
public void setDoctype(DTD dtd)
- Set the DTD
- Parameters:
- dtd -
DTD
to set and used while parsing
setSchemaValidationMode
public void setSchemaValidationMode(boolean flag)
- Set the schema validation mode
- Parameters:
- flag - determines whether the XML parser
should invoke schema validating
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
setPreserveWhitespace
public void setPreserveWhitespace(boolean flag)
- Set the white space preserving mode
- Parameters:
- flag - preserving mode
getValidationMode
public boolean getValidationMode()
- Returns the validation mode
- Returns:
-
true
if the XML parser is validating
false
if not
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