|
|||||||||
| Home >> All >> org >> apache >> xalan >> [ xslt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.xalan.xslt
Interface XSLTProcessor

- All Superinterfaces:
- org.xml.sax.DocumentHandler, org.xml.sax.ext.LexicalHandler
- All Known Implementing Classes:
- XSLTEngineImpl
- public interface XSLTProcessor
- extends org.xml.sax.DocumentHandler, org.xml.sax.ext.LexicalHandler
The transformation processor -- use XSLTProcessorFactory to instantiate an implementation of this interface.
It's the responsibility of the implementation (XSLTEngineImpl),
collaborating with a XMLParserLiaison, the DOM,
and the XPath engine, to transform a source tree
of nodes into a result tree according to instructions
and templates specified by a stylesheet tree.
Use the process(...) are the primary
public entry points.
Look at the Process class main() method for
for an advanced usage example.
If you reuse the processor instance, you should call reset() between transformations.
| Method Summary | |
void |
addTraceListener(org.apache.xalan.xslt.trace.TraceListener tl)
Add a trace listener for the purposes of debugging and diagnosis. |
org.apache.xalan.xpath.XBoolean |
createXBoolean(boolean b)
Convenience function to create an XBoolean. |
org.apache.xalan.xpath.XNodeSet |
createXNodeSet(org.w3c.dom.Node n)
Convenience function to create an XNodeSet from a node. |
org.apache.xalan.xpath.XNodeSet |
createXNodeSet(org.w3c.dom.NodeList nl)
Convenience function to create an XNodeSet. |
org.apache.xalan.xpath.XNull |
createXNull()
Convenience function to create an XNull. |
org.apache.xalan.xpath.XNumber |
createXNumber(double d)
Convenience function to create an XNumber. |
org.apache.xalan.xpath.XObject |
createXObject(java.lang.Object o)
Convenience function to create an XObject. |
org.apache.xalan.xpath.XString |
createXString(java.lang.String s)
Convenience function to create an XString. |
StylesheetSpec |
getAssociatedStylesheet(XSLTInputSource source,
java.lang.String media,
java.lang.String charset)
Get the preferred stylesheet for the XSLTInputSource XML document, as identified by the xml-stylesheet PI, and matching the media and charset criteria. |
java.util.Vector |
getAssociatedStylesheets(XSLTInputSource source,
java.lang.String media,
java.lang.String charset)
Get a list of stylesheet specifications for the XSLTInputSource XML document, as identified by the xml-stylesheet PI, and matching the media and charset criteria. |
org.xml.sax.DocumentHandler |
getDocumentHandler()
Get the current SAX DocumentHandler (the same object as the FormatterListener), or null if none has been set. |
org.xml.sax.DocumentHandler |
getFormatterListener()
Get the current FormatterListener (SAX DocumentHandler), or null if none has been set. |
org.apache.xalan.xpath.xml.ProblemListener |
getProblemListener()
Get the problem listener property. |
org.w3c.dom.Node |
getSourceTreeFromInput(XSLTInputSource inputSource)
Get the DOM Node from the XSLTInputSource object. |
StylesheetRoot |
getStylesheet()
Get the current Stylesheet setting for this XSLTProcessor. |
org.apache.xalan.xpath.xml.XMLParserLiaison |
getXMLProcessorLiaison()
Get the XMLParserLiaison that this processor uses. |
void |
process(XSLTInputSource xmlSource,
XSLTInputSource xslStylesheet,
XSLTResultTarget resultTree)
Use the XSL stylesheet to transform the XML input, placing the result in the result tree. |
StylesheetRoot |
processStylesheet(java.lang.String xsldocURLString)
Given a URL to (or file name of) an XSL stylesheet, Compile the stylesheet into an internal representation, and use it to set the XSLTProcessor Stylesheet property. |
StylesheetRoot |
processStylesheet(XSLTInputSource stylesheetSource)
Compile the XSL stylesheet represented by an XSLTInputSource object into an internal representation, and use it to set the XSLTProcessor Stylesheet property. |
void |
removeTraceListener(org.apache.xalan.xslt.trace.TraceListener tl)
Remove a trace listener. |
void |
reset()
Reset the XSLTProcessor state. |
void |
setDiagnosticsOutput(java.io.OutputStream out)
If set, diagnostics will be written to the m_diagnosticsPrintWriter stream. |
void |
setDiagnosticsOutput(java.io.PrintWriter pw)
If set, diagnostics will be written to the m_diagnosticsPrintWriter stream. |
void |
setDocumentHandler(org.xml.sax.DocumentHandler listener)
Set the current SAX DocumentHandler (the same object as the FormatterListener). |
void |
setFormatterListener(org.xml.sax.DocumentHandler flistener)
Set the FormatterListener (the SAX DocumentHandler). |
void |
setOutputStream(java.io.OutputStream os)
Set the output stream. |
void |
setProblemListener(org.apache.xalan.xpath.xml.ProblemListener l)
Set the problem listener property. |
void |
setQuietConflictWarnings(boolean b)
If set to true (the default), pattern conflict warnings are not printed to the diagnostics stream. |
void |
setStylesheet(StylesheetRoot stylesheetRoot)
Use a compiled stylesheet to set the Stylesheet property for this processor. |
void |
setStylesheetParam(java.lang.String key,
java.lang.String expression)
Set a top-level stylesheet parameter. |
void |
setStylesheetParam(java.lang.String key,
org.apache.xalan.xpath.XObject value)
Submit a top-level stylesheet parameter. |
void |
setTraceSelect(boolean b)
If set to true, selection events are traced. |
void |
setTraceTemplateChildren(boolean b)
If set to true (the default is false), as template children are being constructed, debug diagnostics are written to the m_diagnosticsPrintWriter stream. |
void |
setTraceTemplates(boolean b)
If set to true, template calls are traced. |
| Methods inherited from interface org.xml.sax.DocumentHandler |
characters, endDocument, endElement, ignorableWhitespace, processingInstruction, setDocumentLocator, startDocument, startElement |
| Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
| Method Detail |
process
public void process(XSLTInputSource xmlSource, XSLTInputSource xslStylesheet, XSLTResultTarget resultTree) throws org.xml.sax.SAXException
- Use the XSL stylesheet to transform the XML input, placing the result in the result tree.
processStylesheet
public StylesheetRoot processStylesheet(XSLTInputSource stylesheetSource) throws org.xml.sax.SAXException
- Compile the XSL stylesheet represented by an XSLTInputSource object into an internal representation,
and use it to set the XSLTProcessor Stylesheet property.
This operation is required if the XSLTProcessor is to function as a
SAX DocumentHandler.
If the Stylesheet property has already been set to non-null, this operation
calls reset() before a transformation is performed.
processStylesheet
public StylesheetRoot processStylesheet(java.lang.String xsldocURLString) throws org.xml.sax.SAXException
- Given a URL to (or file name of) an XSL stylesheet,
Compile the stylesheet into an internal representation, and use it to
set the XSLTProcessor Stylesheet property.
This operation is required if the XSLTProcessor is to function as a
SAX DocumentHandler.
If the Stylesheet property has already been set to non-null, this operation
calls reset() before a transformation is performed.
setOutputStream
public void setOutputStream(java.io.OutputStream os)
- Set the output stream. Required when the XSLTProcessor is being used
as a SAX DocumentHandler.
reset
public void reset()
- Reset the XSLTProcessor state. Must be used after a process() call
if the XSLTProcessor instance is to be used again.
getSourceTreeFromInput
public org.w3c.dom.Node getSourceTreeFromInput(XSLTInputSource inputSource) throws org.xml.sax.SAXException
- Get the DOM Node from the XSLTInputSource object. Returns null if the XSLTInputSource
object does not contain a Node (it may, for example, contain an input stream).
setStylesheet
public void setStylesheet(StylesheetRoot stylesheetRoot)
- Use a compiled stylesheet to set the Stylesheet property for this processor.
When this property is set, the process method uses this stylesheet rather than
looking for a stylesheet PI if the stylesheet parameter is null. Also required
if you are going to use the XSLTProcessor as a SAX DocumentHandler.
getStylesheet
public StylesheetRoot getStylesheet()
- Get the current Stylesheet setting for this XSLTProcessor.
getXMLProcessorLiaison
public org.apache.xalan.xpath.xml.XMLParserLiaison getXMLProcessorLiaison()
- Get the XMLParserLiaison that this processor uses.
getAssociatedStylesheet
public StylesheetSpec getAssociatedStylesheet(XSLTInputSource source, java.lang.String media, java.lang.String charset) throws org.xml.sax.SAXException
- Get the preferred stylesheet for the XSLTInputSource XML document,
as identified by the xml-stylesheet PI, and matching the media and
charset criteria. See
http://www.w3.org/TR/xml-stylesheet/ Associating Style Sheets with XML documentsDoes not yet handle the LINK REL="stylesheet" syntax.
getAssociatedStylesheets
public java.util.Vector getAssociatedStylesheets(XSLTInputSource source, java.lang.String media, java.lang.String charset) throws org.xml.sax.SAXException
- Get a list of stylesheet specifications for the XSLTInputSource XML document,
as identified by the xml-stylesheet PI, and matching the media and
charset criteria. See
http://www.w3.org/TR/xml-stylesheet/ Associating Style Sheets with XML documents. Does not yet handle the LINK REL="stylesheet" syntax.
createXString
public org.apache.xalan.xpath.XString createXString(java.lang.String s)
- Convenience function to create an XString.
createXObject
public org.apache.xalan.xpath.XObject createXObject(java.lang.Object o)
- Convenience function to create an XObject.
createXNumber
public org.apache.xalan.xpath.XNumber createXNumber(double d)
- Convenience function to create an XNumber.
createXBoolean
public org.apache.xalan.xpath.XBoolean createXBoolean(boolean b)
- Convenience function to create an XBoolean.
createXNodeSet
public org.apache.xalan.xpath.XNodeSet createXNodeSet(org.w3c.dom.NodeList nl)
- Convenience function to create an XNodeSet.
createXNodeSet
public org.apache.xalan.xpath.XNodeSet createXNodeSet(org.w3c.dom.Node n)
- Convenience function to create an XNodeSet from a node.
createXNull
public org.apache.xalan.xpath.XNull createXNull()
- Convenience function to create an XNull.
setStylesheetParam
public void setStylesheetParam(java.lang.String key, org.apache.xalan.xpath.XObject value)
- Submit a top-level stylesheet parameter. This value can
be evaluated in the stylesheet via xsl:param-variable.
setStylesheetParam
public void setStylesheetParam(java.lang.String key, java.lang.String expression)
- Set a top-level stylesheet parameter. This value can
be evaluated via xsl:param-variable. Note that the value
passed is an expression, and not a string. This means that
setStylesheetParam("foo", "hello"); will look for the
element "hello". If you want to pass a string, you'll
need to put quotes around it:
setStylesheetParam("foo", "'hello'"); will look for the
getFormatterListener
public org.xml.sax.DocumentHandler getFormatterListener()
- Get the current FormatterListener (SAX DocumentHandler), or null if none has been set.
setFormatterListener
public void setFormatterListener(org.xml.sax.DocumentHandler flistener)
- Set the FormatterListener (the SAX DocumentHandler).
getDocumentHandler
public org.xml.sax.DocumentHandler getDocumentHandler()
- Get the current SAX DocumentHandler (the same object as the FormatterListener), or null if none has been set.
setDocumentHandler
public void setDocumentHandler(org.xml.sax.DocumentHandler listener)
- Set the current SAX DocumentHandler (the same
object as the FormatterListener).
addTraceListener
public void addTraceListener(org.apache.xalan.xslt.trace.TraceListener tl) throws java.util.TooManyListenersException
- Add a trace listener for the purposes of debugging and diagnosis.
setTraceTemplates
public void setTraceTemplates(boolean b)
- If set to true, template calls are traced.
setTraceSelect
public void setTraceSelect(boolean b)
- If set to true, selection events are traced.
setTraceTemplateChildren
public void setTraceTemplateChildren(boolean b)
- If set to true (the default is false), as template children are being constructed, debug diagnostics
are written to the m_diagnosticsPrintWriter
stream.
setQuietConflictWarnings
public void setQuietConflictWarnings(boolean b)
- If set to true (the default), pattern conflict warnings are not printed to the diagnostics stream.
removeTraceListener
public void removeTraceListener(org.apache.xalan.xslt.trace.TraceListener tl)
- Remove a trace listener.
setDiagnosticsOutput
public void setDiagnosticsOutput(java.io.OutputStream out)
- If set, diagnostics will be
written to the m_diagnosticsPrintWriter stream. If
null, diagnostics are turned off. This convenience method calls
setDiagnosticsOutput(java.io.PrintWriter)55 .
setDiagnosticsOutput
public void setDiagnosticsOutput(java.io.PrintWriter pw)
- If set, diagnostics will be
written to the m_diagnosticsPrintWriter stream. If
null, diagnostics are turned off.
setProblemListener
public void setProblemListener(org.apache.xalan.xpath.xml.ProblemListener l)
- Set the problem listener property.
The XSL class can have a single listener to be informed
of errors and warnings. The problem listener normally controls whether an exception
is thrown or not (or the problem listeners can throw its own RuntimeException).
getProblemListener
public org.apache.xalan.xpath.xml.ProblemListener getProblemListener()
- Get the problem listener property.
The XSL class can have a single listener to be informed
of errors and warnings. The problem listener normally controls whether an exception
is thrown or not (or the problem listener can throw its own RuntimeException).
|
|||||||||
| Home >> All >> org >> apache >> xalan >> [ xslt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC