BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.apache.xalan.xslt
Class StylesheetRoot

java.lang.Object
  |
  +--weblogic.apache.xalan.xslt.StylesheetRoot

public class StylesheetRoot
extends java.lang.Object

Binary representation of a stylesheet -- use the XSLTProcessor ProcessStylesheet method to create a StylesheetRoot and improve performance for a stylesheet performing multiple transformations. Also required for XSLTProcessor to function as SAX DocumentHandler.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.


Constructor Summary
StylesheetRoot(StylesheetRoot s)
          Constructor using an weblogic.apache.xalan.templates.StylesheetRoot.
StylesheetRoot(XSLTEngineImpl processor, java.lang.String baseIdentifier)
          Uses an XSL stylesheet document.
 
Method Summary
 java.lang.String getBaseIdentifier()
          Get the base identifier with which this stylesheet is associated.
 StylesheetRoot getObject()
          Return the weblogic.apache.xalan.templates.StylesheetRoot object associated with this stylesheet root.
 java.lang.String getOutputEncoding()
          Get the encoding string that was specified in the stylesheet.
 OutputFormat getOutputFormat()
          Get a new OutputFormat object according to the xsl:output attributes.
 java.lang.String getOutputMediaType()
          Get the media-type string that was specified in the stylesheet.
 java.lang.String getOutputMethod()
          Get the output method that was specified in the stylesheet.
 org.xml.sax.DocumentHandler getSAXSerializer(java.io.OutputStream ostream)
          Creates a compatible SAX serializer for the specified output stream and output format.
 org.xml.sax.DocumentHandler makeSAXSerializer(java.io.OutputStream ostream, OutputFormat format)
          Creates a compatible SAX serializer for the specified output stream and output format.
 org.xml.sax.DocumentHandler makeSAXSerializer(java.io.Writer writer, OutputFormat format)
          Creates a compatible SAX serializer for the specified writer and output format.
 void process(XSLTInputSource xmlSource, XSLTResultTarget outputTarget)
          Transform the XML source tree and place the output in the result tree target.
 void process(XSLTProcessor iprocessor, org.w3c.dom.Node sourceTree, XSLTResultTarget outputTarget)
          Transform the XML source tree (a DOM Node) and place the output in the result tree target.
 void process(XSLTProcessor iprocessor, XSLTInputSource xmlSource, XSLTResultTarget outputTarget)
          Transform the XML source tree and place the output in the result tree target.
 void setBaseIdentifier(java.lang.String baseIdent)
          Get the base identifier with which this stylesheet is associated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StylesheetRoot

public StylesheetRoot(XSLTEngineImpl processor,
                      java.lang.String baseIdentifier)
               throws javax.xml.transform.TransformerConfigurationException
Uses an XSL stylesheet document.

Parameters:
processor - The XSLTProcessor implementation.
baseIdentifier - The file name or URL for the XSL stylesheet.
Throws:
javax.xml.transform.TransformerConfigurationException - thrown

StylesheetRoot

public StylesheetRoot(StylesheetRoot s)
Constructor using an weblogic.apache.xalan.templates.StylesheetRoot.

Parameters:
s - an weblogic.apache.xalan.templates.StylesheetRoot object
Method Detail

getObject

public StylesheetRoot getObject()
Return the weblogic.apache.xalan.templates.StylesheetRoot object associated with this stylesheet root.

Returns:
an weblogic.apache.xalan.templates.StylesheetRoot object

process

public void process(XSLTInputSource xmlSource,
                    XSLTResultTarget outputTarget)
             throws org.xml.sax.SAXException,
                    java.net.MalformedURLException,
                    java.io.FileNotFoundException,
                    java.io.IOException
Transform the XML source tree and place the output in the result tree target. This method uses a new XSLTProcessor instance to track the running state.

Parameters:
xmlSource - The XML input source tree.
outputTarget - The output result tree.
Throws:
org.xml.sax.SAXException -  
See Also:
XSLTProcessor.process(weblogic.apache.xalan.xslt.XSLTInputSource, weblogic.apache.xalan.xslt.XSLTInputSource, weblogic.apache.xalan.xslt.XSLTResultTarget)

process

public void process(XSLTProcessor iprocessor,
                    XSLTInputSource xmlSource,
                    XSLTResultTarget outputTarget)
             throws org.xml.sax.SAXException,
                    java.net.MalformedURLException,
                    java.io.FileNotFoundException,
                    java.io.IOException
Transform the XML source tree and place the output in the result tree target. Use this version of the StylesheetRoot process() method if you have used an XSLTProcessor object to set a stylesheet parameter. That object is now the iprocessor parameter.

Parameters:
iprocessor - The XSLTProcessor that will track the running state.
xmlSource - The XML input source tree.
outputTarget - The output result tree.
Throws:
org.xml.sax.SAXException -  
See Also:
XSLTProcessor.process(weblogic.apache.xalan.xslt.XSLTInputSource, weblogic.apache.xalan.xslt.XSLTInputSource, weblogic.apache.xalan.xslt.XSLTResultTarget)

process

public void process(XSLTProcessor iprocessor,
                    org.w3c.dom.Node sourceTree,
                    XSLTResultTarget outputTarget)
             throws org.xml.sax.SAXException,
                    java.net.MalformedURLException,
                    java.io.FileNotFoundException,
                    java.io.IOException
Transform the XML source tree (a DOM Node) and place the output in the result tree target. This is a convenience method. You can also use a DOM Node to instantiate an XSLTInputSource object, and call process(weblogic.apache.xalan.xslt.XSLTProcessor, weblogic.apache.xalan.xslt.XSLTInputSource, weblogic.apache.xalan.xslt.XSLTResultTarget) or XSLTProcessor.process(weblogic.apache.xalan.xslt.XSLTInputSource, weblogic.apache.xalan.xslt.XSLTInputSource, weblogic.apache.xalan.xslt.XSLTResultTarget).

Parameters:
iprocessor - The processor that will track the running state.
sourceTree - The input source tree in the form of a DOM Node.
outputTarget - The output result tree.
Throws:
org.xml.sax.SAXException -  

makeSAXSerializer

public org.xml.sax.DocumentHandler makeSAXSerializer(java.io.Writer writer,
                                                     OutputFormat format)
                                              throws java.io.IOException,
                                                     org.xml.sax.SAXException
Creates a compatible SAX serializer for the specified writer and output format. If the output format is missing, the default is an XML format with UTF8 encoding.

Parameters:
writer - The writer
format - The output format
Returns:
A compatible SAX serializer

makeSAXSerializer

public org.xml.sax.DocumentHandler makeSAXSerializer(java.io.OutputStream ostream,
                                                     OutputFormat format)
                                              throws java.io.UnsupportedEncodingException,
                                                     java.io.IOException,
                                                     org.xml.sax.SAXException
Creates a compatible SAX serializer for the specified output stream and output format. If the output format is missing, the default is an XML format with UTF8 encoding.

Parameters:
ostream - The output stream.
format - The output format
Returns:
A compatible SAX serializer

getSAXSerializer

public org.xml.sax.DocumentHandler getSAXSerializer(java.io.OutputStream ostream)
                                             throws java.io.UnsupportedEncodingException,
                                                    java.io.IOException,
                                                    org.xml.sax.SAXException
Creates a compatible SAX serializer for the specified output stream and output format. If the output format is missing, the default is an XML format with UTF8 encoding.

Parameters:
ostream - The output stream.
Returns:
A compatible SAX serializer

getOutputFormat

public OutputFormat getOutputFormat()
Get a new OutputFormat object according to the xsl:output attributes.

getOutputEncoding

public java.lang.String getOutputEncoding()
Get the encoding string that was specified in the stylesheet.

getOutputMediaType

public java.lang.String getOutputMediaType()
Get the media-type string that was specified in the stylesheet.

getOutputMethod

public java.lang.String getOutputMethod()
Get the output method that was specified in the stylesheet.

getBaseIdentifier

public java.lang.String getBaseIdentifier()
Get the base identifier with which this stylesheet is associated.

setBaseIdentifier

public void setBaseIdentifier(java.lang.String baseIdent)
Get the base identifier with which this stylesheet is associated.

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.