All Packages Class Hierarchy This Package Previous Next Index
Class org.xmlmiddleware.xmlutils.external.ParserUtilsXerces
java.lang.Object
|
+----org.xmlmiddleware.xmlutils.external.ParserUtilsXerces
- public class ParserUtilsXerces
- extends Object
- implements ParserUtils
Implements ParserUtils for the Xerces parser.
Supports any(?) version of Xerces that supports JAXP.
- Version:
- 2.0
- Author:
- Adam Flinton, Paul Gubbay
-
ParserUtilsXerces()
- Construct a ParserUtilsXerces object.
-
getDOMImplementation()
- Get a DOMImplementation object.
-
getXMLReader(boolean)
- Return an object that wraps an XMLReader.
-
openDocument(InputSource, boolean)
- Open an InputSource and create a DOM Document
-
writeDocument(Document)
- Write a DOM Document to a String.
-
writeDocument(Document, String, String)
- Write a DOM Document to a file.
ParserUtilsXerces
public ParserUtilsXerces()
- Construct a ParserUtilsXerces object.
getXMLReader
public XMLReader getXMLReader(boolean validating) throws XMLMiddlewareException
- Return an object that wraps an XMLReader. The XMLReader is wrapped
within the SAXParser.
- Parameters:
- validating - Whether the XMLReader performs validation.
- Returns:
- XMLReader wrapped within a SAXParser
- Throws: XMLMiddlewareException
- thrown when the SAXParserFactory encounters
a problem creating a new SAXParser
getDOMImplementation
public DOMImplementation getDOMImplementation() throws XMLMiddlewareException
- Get a DOMImplementation object.
- Returns:
- The DOMImplementation object
- Throws: XMLMiddlewareException
- Thrown if an error occurs instantiating
the DOMImplementation.
openDocument
public Document openDocument(InputSource src,
boolean validate) throws XMLMiddlewareException
- Open an InputSource and create a DOM Document
- Parameters:
- src - SAX InputSource to be parsed into a Document
- validate - Whether the InputSource is validated.
- Returns:
- Document containing a DOM representation of InputSource
- Throws: XMLMiddlewareException
- Thrown if there is a problem parsing the
InputSource
writeDocument
public void writeDocument(Document doc,
String xmlFilename,
String encoding) throws XMLMiddlewareException
- Write a DOM Document to a file.
- Parameters:
- doc - The DOM Document.
- xmlFilename - The name of the XML file.
- encoding - The output encoding to use. If this is null, the default
encoding is used.
- Throws: XMLMiddlewareException
- Thrown if an error occurs writing the
DOM Document.
writeDocument
public String writeDocument(Document doc) throws XMLMiddlewareException
- Write a DOM Document to a String.
- Parameters:
- doc - The DOM Document.
- Returns:
- The XML string.
- Throws: XMLMiddlewareException
- Thrown if an error occurs writing the
DOM Document.
All Packages Class Hierarchy This Package Previous Next Index