Package org.exolab.adaptx.xslt
Class XSLTReader
- java.lang.Object
-
- org.exolab.adaptx.util.ErrorObserverAdapter
-
- org.exolab.adaptx.xslt.XSLTReader
-
- All Implemented Interfaces:
ErrorObserver
public class XSLTReader extends ErrorObserverAdapter
A class for reading an XSLT stylesheet from a stream or file.- Version:
- $Revision: 3925 $ $Date: 2003-10-01 10:50:32 +0200 (Wed, 01 Oct 2003) $
Modifcations 19990804: Mike Los (comments with MEL) - modified #readDocument to close InputStream
- Author:
- Keith Visco
-
-
Field Summary
-
Fields inherited from interface org.exolab.adaptx.util.ErrorObserver
FATAL, NORMAL, WARNING
-
-
Constructor Summary
Constructors Constructor Description XSLTReader()
Creates a new Default XSLTReaderXSLTReader(URIResolver uriResolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addErrorObserver(ErrorObserver observer)
Adds the given ErrorObserver to the list of ErrorObservers for this XSLReaderURIResolver
getURIResolver()
Returns the URIResolver being used by this XSLReaderXSLTStylesheet
read(java.lang.String uri)
Reads an XSL stylesheet from the given uri (filename)XSLTStylesheet
read(java.lang.String uri, java.lang.String documentBase)
Reads an XSL stylesheet from the given uri, using the given documentBase to resolve relative URI's.XSLTStylesheet
read(java.net.URL url)
Reads the XSLStylesheet pointed to by the given URLXSLTStylesheet
read(URILocation location)
Reads an XSLStylesheet from the given URILocationXSLTStylesheet
read(org.w3c.dom.Document document, java.lang.String filename)
Reads an XSL stylesheet using the given DOM DocumentXSLTStylesheet
read(org.w3c.dom.Node node, java.lang.String filename)
Reads an XSL stylesheet using the given DOM NodeXSLTStylesheet
read(org.xml.sax.InputSource source)
Reads an XSL stylesheet from the given uri (filename)void
setEntityResolver(org.xml.sax.EntityResolver resolver)
Sets an EntityResolver to be passed to the underlying XML parser.void
setURIResolver(URIResolver resolver)
Sets the URIResolver for this XSLReader-
Methods inherited from class org.exolab.adaptx.util.ErrorObserverAdapter
receiveError, receiveError, receiveError, receiveError, receiveError, receiveError, removeAllErrorObservers, removeErrorObserver
-
-
-
-
Constructor Detail
-
XSLTReader
public XSLTReader()
Creates a new Default XSLTReader
-
XSLTReader
public XSLTReader(URIResolver uriResolver)
-
-
Method Detail
-
addErrorObserver
public void addErrorObserver(ErrorObserver observer)
Adds the given ErrorObserver to the list of ErrorObservers for this XSLReader- Overrides:
addErrorObserver
in classErrorObserverAdapter
- Parameters:
observer
- the ErrorObserver to add
-
getURIResolver
public URIResolver getURIResolver()
Returns the URIResolver being used by this XSLReader- Returns:
- the URIResolver being used by this XSLReader
-
read
public XSLTStylesheet read(java.net.URL url) throws XSLException, java.io.IOException
Reads the XSLStylesheet pointed to by the given URL- Parameters:
url
- the URL of the stylesheet- Returns:
- the XSLStylesheet
- Throws:
XSLException
java.io.IOException
-
read
public XSLTStylesheet read(org.w3c.dom.Document document, java.lang.String filename) throws XSLException
Reads an XSL stylesheet using the given DOM Document- Parameters:
Document
- the DOM Document that is the Stylesheetfilename
- the full path and filename of the Stylesheet which is used for resolving relative URIs.- Throws:
XSLException
-
read
public XSLTStylesheet read(org.w3c.dom.Node node, java.lang.String filename) throws XSLException
Reads an XSL stylesheet using the given DOM Node- Parameters:
node
- the DOM Node that contains the Stylesheetfilename
- the full path and filename of the Stylesheet which is used for resolving relative URIs.- Throws:
XSLException
-
read
public XSLTStylesheet read(org.xml.sax.InputSource source) throws XSLException, java.io.IOException
Reads an XSL stylesheet from the given uri (filename)- Parameters:
uri
- the file name of the XSLT stylesheet to read- Returns:
- the new XSLStylesheet
- Throws:
XSLException
java.io.IOException
-
read
public XSLTStylesheet read(java.lang.String uri) throws XSLException, java.io.IOException
Reads an XSL stylesheet from the given uri (filename)- Parameters:
uri
- the file name of the XSLT stylesheet to read- Returns:
- the new XSLStylesheet
- Throws:
XSLException
java.io.IOException
-
read
public XSLTStylesheet read(java.lang.String uri, java.lang.String documentBase) throws XSLException, java.io.IOException
Reads an XSL stylesheet from the given uri, using the given documentBase to resolve relative URI's.- Parameters:
uri
- the file name of the XSLT stylesheet to read- Returns:
- the new XSLStylesheet
- Throws:
XSLException
java.io.IOException
-
read
public XSLTStylesheet read(URILocation location) throws XSLException, java.io.IOException
Reads an XSLStylesheet from the given URILocation- Parameters:
location
- the URILocation of the XSLT stylesheet- Returns:
- the new XSLStylesheet
- Throws:
XSLException
java.io.IOException
-
setEntityResolver
public void setEntityResolver(org.xml.sax.EntityResolver resolver)
Sets an EntityResolver to be passed to the underlying XML parser. The EntityResolver will be passed to any SAX parser. If no SAX parser is utilized during the reading of the stylesheet, the resolver will be ignored.- Parameters:
resolver
- the EntityResolver to use
-
setURIResolver
public void setURIResolver(URIResolver resolver)
Sets the URIResolver for this XSLReader- Parameters:
resolver
- the URIResolver this XSLReader should use for resolving all URIs.
-
-