|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.xml.transform.Transformer org.apache.xalan.transformer.TransformerImpl
public class TransformerImpl
This class implements the
Transformer
interface, and is the core
representation of the transformation execution.
Field Summary | |
---|---|
(package private) java.util.Stack |
m_attrSetStack
Stack for the purposes of flagging infinite recursion with attribute sets. |
(package private) CountersTable |
m_countersTable
The table of counters for xsl:number support. |
(package private) ObjectStack |
m_currentFuncResult
Keeps track of the result delivered by any EXSLT func:result
instruction that has been executed for the currently active EXSLT
func:function |
(package private) NodeVector |
m_currentMatchedNodes
A node vector used as a stack to track the current node that was matched. |
(package private) java.util.Stack |
m_currentMatchTemplates
A node vector used as a stack to track the current ElemTemplate that was matched. |
(package private) ObjectStack |
m_currentTemplateElements
A node vector used as a stack to track the current ElemTemplateElement. |
(package private) BoolStack |
m_currentTemplateRuleIsNull
Is > 0 when we're processing a for-each. |
private boolean |
m_debug
This is a compile-time flag to turn off calling of trace listeners. |
private int |
m_doc
This is needed for support of setSourceTreeDocForThread(Node doc), which must be called in order for the transform thread's run method to obtain the root of the source tree to be transformed. |
(package private) javax.xml.parsers.DocumentBuilder |
m_docBuilder
The JAXP Document Builder, mainly to create Result Tree Fragments. |
private javax.xml.transform.ErrorListener |
m_errorHandler
The SAX error handler, where errors and warnings are sent. |
private java.lang.Exception |
m_exceptionThrown
If the transform thread throws an exception, the exception needs to be stashed away so that the main thread can pass it on to the client. |
private ExtensionsTable |
m_extensionsTable
The table of ExtensionHandlers. |
private boolean |
m_hasBeenReset
Flag to to tell if the tranformer needs to be reset. |
private boolean |
m_hasTransformThreadErrorCatcher
NEEDSDOC Field m_hasTransformThreadErrorCatcher |
private boolean |
m_incremental
The flag for the setting of the incremental feature; This flag should have the same value as the FEATURE_INCREMENTAL feature which is set by the TransformerFactory.setAttribut() method before a Transformer is created |
(package private) org.xml.sax.ContentHandler |
m_inputContentHandler
The content handler for the source input tree. |
private boolean |
m_isTransformDone
If the the transform is on the secondary thread, we need to know when it is done, so we can return. |
private KeyManager |
m_keyManager
The key manager, which manages xsl:keys. |
private java.util.Stack |
m_modes
A stack of current template modes. |
private MsgMgr |
m_msgMgr
The message manager, which manages error messages, warning messages, and other types of message events. |
private boolean |
m_optimizer
The flag for the setting of the optimize feature; This flag should have the same value as the FEATURE_OPTIMIZE feature which is set by the TransformerFactory.setAttribut() method before a Transformer is created |
private org.xml.sax.ContentHandler |
m_outputContentHandler
The content handler for the result tree. |
private OutputProperties |
m_outputFormat
The output format object set by the user. |
private java.io.FileOutputStream |
m_outputStream
This is null unless we own the stream. |
private javax.xml.transform.Result |
m_outputTarget
The Result object at the start of the transform, if any. |
private boolean |
m_parserEventsOnMain
True if the parser events should be on the main thread, false if not. |
private boolean |
m_quietConflictWarnings
If this is set to true, do not warn about pattern match conflicts. |
private java.lang.Boolean |
m_reentryGuard
NEEDSDOC Field m_reentryGuard |
private SerializationHandler |
m_serializationHandler
Output handler to bottleneck SAX events. |
private boolean |
m_shouldReset
NEEDSDOC Field m_shouldReset |
private boolean |
m_source_location
The flag for the setting of the source_location feature; This flag should have the same value as the FEATURE_SOURCE_LOCATION feature which is set by the TransformerFactory.setAttribut() method before a Transformer is created |
private StackGuard |
m_stackGuard
Object to guard agains infinite recursion when doing queries. |
private ObjectPool |
m_stringWriterObjectPool
Related to m_textResultHandlerObjectPool, this is a pool of StringWriters, which are passed to the Text Serializers. |
private StylesheetRoot |
m_stylesheetRoot
The root of a linked set of stylesheets. |
private OutputProperties |
m_textformat
A static text format object, which can be used over and over to create the text serializers. |
private ObjectPool |
m_textResultHandlerObjectPool
A pool of ResultTreeHandlers, for serialization of a subtree to text. |
private TraceManager |
m_traceManager
The trace manager. |
private java.lang.Thread |
m_transformThread
The thread that the transformer is running on. |
private java.lang.String |
m_urlOfSource
The base URL of the source tree. |
(package private) java.util.Vector |
m_userParams
NEEDSDOC Field m_userParams |
private XPathContext |
m_xcontext
The liason to the XML parser, so the XSL processor can handle included files, and the like, and do the initial parse of the XSL document. |
private javax.xml.transform.Source |
m_xmlSource
The InputSource for the source tree, which is needed if the parse thread is not the main thread, in order for the parse thread's run method to get to the input source. |
Fields inherited from interface org.apache.xml.dtm.DTMWSFilter |
---|
INHERIT, NOTSTRIP, STRIP |
Fields inherited from interface org.apache.xml.serializer.SerializerTrace |
---|
EVENTTYPE_CDATA, EVENTTYPE_CHARACTERS, EVENTTYPE_COMMENT, EVENTTYPE_ENDDOCUMENT, EVENTTYPE_ENDELEMENT, EVENTTYPE_ENTITYREF, EVENTTYPE_IGNORABLEWHITESPACE, EVENTTYPE_OUTPUT_CHARACTERS, EVENTTYPE_OUTPUT_PSEUDO_CHARACTERS, EVENTTYPE_PI, EVENTTYPE_STARTDOCUMENT, EVENTTYPE_STARTELEMENT |
Constructor Summary | |
---|---|
TransformerImpl(StylesheetRoot stylesheet)
Construct a TransformerImpl. |
Method Summary | |
---|---|
boolean |
applyTemplateToNode(ElemTemplateElement xslInstruction,
ElemTemplate template,
int child)
Given an element and mode, find the corresponding template and process the contents. |
void |
clearParameters()
Reset the parameters to a null list. |
SerializationHandler |
createSerializationHandler(javax.xml.transform.Result outputTarget)
Create a result ContentHandler from a Result object, based on the current OutputProperties. |
SerializationHandler |
createSerializationHandler(javax.xml.transform.Result outputTarget,
OutputProperties format)
Create a ContentHandler from a Result object and an OutputProperties. |
boolean |
currentFuncResultSeen()
Determines whether an EXSLT func:result instruction has been
executed for the currently active EXSLT func:function . |
boolean |
currentTemplateRuleIsNull()
Tell if the current template rule is null, i.e. |
boolean |
elementAvailable(java.lang.String ns,
java.lang.String elemName)
Is the extension element available? |
void |
executeChildTemplates(ElemTemplateElement elem,
boolean shouldAddAttrs)
Execute each of the children of a template element. |
void |
executeChildTemplates(ElemTemplateElement elem,
org.xml.sax.ContentHandler handler)
Execute each of the children of a template element. |
void |
executeChildTemplates(ElemTemplateElement elem,
org.w3c.dom.Node context,
QName mode,
org.xml.sax.ContentHandler handler)
Execute each of the children of a template element. |
void |
executeFromSnapshot(TransformSnapshot ts)
Deprecated. This is an internal tooling API that nobody seems to be using |
java.lang.Object |
extFunction(FuncExtFunction extFunction,
java.util.Vector argVec)
Execute the extension function. |
java.lang.Object |
extFunction(java.lang.String ns,
java.lang.String funcName,
java.util.Vector argVec,
java.lang.Object methodKey)
Execute the extension function. |
private void |
fatalError(java.lang.Throwable throwable)
|
void |
fireGenerateEvent(int eventType)
Fire off startDocument, endDocument events. |
void |
fireGenerateEvent(int eventType,
char[] ch,
int start,
int length)
Fire off characters, cdate events. |
void |
fireGenerateEvent(int eventType,
java.lang.String data)
Fire off comment and entity ref events. |
void |
fireGenerateEvent(int eventType,
java.lang.String name,
org.xml.sax.Attributes atts)
Fire off startElement, endElement events. |
void |
fireGenerateEvent(int eventType,
java.lang.String name,
java.lang.String data)
Fire off processingInstruction events. |
boolean |
functionAvailable(java.lang.String ns,
java.lang.String funcName)
Is the extension function available? |
java.lang.String |
getBaseURLOfSource()
Get the base URL of the source. |
org.xml.sax.ContentHandler |
getContentHandler()
Get the content event handler. |
DTMIterator |
getContextNodeList()
Get the current context node list. |
CountersTable |
getCountersTable()
Get the table of counters, for optimized xsl:number support. |
ElemTemplateElement |
getCurrentElement()
Retrieves the current ElemTemplateElement that is being executed. |
int |
getCurrentNode()
This method retrieves the current context node in the source tree. |
ElemTemplate |
getCurrentTemplate()
This method retrieves the xsl:template that is in effect, which may be a matched template or a named template. |
ObjectStack |
getCurrentTemplateElements()
Get the count of how many elements are active. |
int |
getCurrentTemplateElementsCount()
Get the count of how many elements are active. |
boolean |
getDebug()
|
java.util.Vector |
getElementCallstack()
Get the stack of ElemTemplateElements. |
javax.xml.transform.ErrorListener |
getErrorListener()
Get the current error event handler. |
java.lang.Exception |
getExceptionThrown()
Get the exception thrown by the secondary thread (normally the transform thread). |
ExtensionsTable |
getExtensionsTable()
Get the extensions table object. |
boolean |
getFeature(java.lang.String name)
Look up the value of a feature. |
boolean |
getIncremental()
|
org.xml.sax.ContentHandler |
getInputContentHandler()
Get a SAX2 ContentHandler for the input. |
org.xml.sax.ContentHandler |
getInputContentHandler(boolean doDocFrag)
Get a SAX2 ContentHandler for the input. |
org.xml.sax.ext.DeclHandler |
getInputDeclHandler()
Get a SAX2 DeclHandler for the input. |
org.xml.sax.ext.LexicalHandler |
getInputLexicalHandler()
Get a SAX2 LexicalHandler for the input. |
KeyManager |
getKeyManager()
Get the KeyManager object. |
int |
getMatchedNode()
Retrieves the node in the source tree that matched the template obtained via getMatchedTemplate(). |
ElemTemplate |
getMatchedTemplate()
This method retrieves the xsl:template that was matched. |
QName |
getMode()
NEEDSDOC Method getMode NEEDSDOC (getMode) @return |
MsgMgr |
getMsgMgr()
Return the message manager. |
boolean |
getOptimize()
|
OutputProperties |
getOutputFormat()
Get the output properties used for the transformation. |
java.util.Properties |
getOutputProperties()
Get a copy of the output properties for the transformation. |
java.lang.String |
getOutputProperty(java.lang.String qnameString)
Get an output property that is in effect for the transformation. |
java.lang.String |
getOutputPropertyNoDefault(java.lang.String qnameString)
Get the value of a property, without using the default properties. |
javax.xml.transform.Result |
getOutputTarget()
Get the original output target. |
java.lang.Object |
getParameter(java.lang.String name)
Get a parameter that was explicitly set with setParameter or setParameters. |
boolean |
getProperty(java.lang.String property)
getProperty returns the current setting of the
property described by the property argument. |
boolean |
getQuietConflictWarnings()
Get quietConflictWarnings property. |
int |
getRecursionLimit()
Get the recursion limit. |
SerializationHandler |
getResultTreeHandler()
Get the SerializationHandler object. |
SerializationHandler |
getSerializationHandler()
Get the SerializationHandler object. |
short |
getShouldStripSpace(int elementHandle,
DTM dtm)
Test whether whitespace-only text nodes are visible in the logical view of DTM . |
TransformSnapshot |
getSnapshot()
Deprecated. This is an internal tooling API that nobody seems to be using |
boolean |
getSource_location()
|
StackGuard |
getStackGuard()
Get the object used to guard the stack from recursion. |
ObjectPool |
getStringWriterPool()
Get the StringWriter pool, so that StringWriter objects may be reused. |
StylesheetRoot |
getStylesheet()
Get the current stylesheet for this processor. |
java.util.Vector |
getTemplateCallstack()
Get the call stack of xsl:template elements. |
TraceManager |
getTraceManager()
Get an instance of the trace manager for this transformation. |
javax.xml.transform.Transformer |
getTransformer()
Get the TrAX Transformer object in effect. |
java.lang.Thread |
getTransformThread()
Get the thread that the transform process is on. |
javax.xml.transform.URIResolver |
getURIResolver()
Get an object that will be used to resolve URIs used in document(), etc. |
XPathContext |
getXPathContext()
Get the XPath context associated with this transformer. |
boolean |
hasTraceListeners()
Tell if trace listeners are present. |
boolean |
hasTransformThreadErrorCatcher()
Return true if the transform was initiated from the transform method, otherwise it was probably done from a pure parse events. |
void |
init(ToXMLSAXHandler h,
javax.xml.transform.Transformer transformer,
org.xml.sax.ContentHandler realHandler)
Initializer method. |
boolean |
isParserEventsOnMain()
Get true if the parser events should be on the main thread, false if not. |
boolean |
isRecursiveAttrSet(ElemAttributeSet attrSet)
Check to see if this is a recursive attribute definition. |
boolean |
isTransformDone()
Tell if the transform method is completed. |
java.lang.Object |
popCurrentFuncResult()
Pops the result of the currently active EXSLT func:function . |
void |
popCurrentMatched()
Pop the elements that were pushed via pushPairCurrentMatched. |
void |
popCurrentTemplateRuleIsNull()
Push true if the current template rule is null, false otherwise. |
void |
popElemAttributeSet()
Pop the current executing attribute set. |
void |
popElemTemplateElement()
Pop the current template element. |
void |
popMode()
NEEDSDOC Method popMode |
(package private) void |
postExceptionFromThread(java.lang.Exception e)
From a secondary thread, post the exception, so that it can be picked up from the main thread. |
java.util.Vector |
processSortKeys(ElemForEach foreach,
int sourceNodeContext)
Get the keys for the xsl:sort elements. |
void |
pushCurrentFuncResult(java.lang.Object val)
Push a funcion result for the currently active EXSLT func:function . |
void |
pushCurrentTemplateRuleIsNull(boolean b)
Push true if the current template rule is null, false otherwise. |
void |
pushElemAttributeSet(ElemAttributeSet attrSet)
Push an executing attribute set, so we can check for recursive attribute definitions. |
void |
pushElemTemplateElement(ElemTemplateElement elem)
Push the current template element. |
protected void |
pushGlobalVars(int contextNode)
Internal -- push the global variables from the Stylesheet onto the context's runtime variable stack. |
void |
pushMode(QName mode)
NEEDSDOC Method pushMode NEEDSDOC @param mode |
void |
pushPairCurrentMatched(ElemTemplateElement template,
int child)
Push both the current xsl:template or xsl:for-each onto the stack, along with the child node that was matched. |
private void |
replaceOrPushUserParam(QName qname,
XObject xval)
NEEDSDOC Method replaceOrPushUserParam NEEDSDOC @param qname NEEDSDOC @param xval |
void |
reset()
Reset the state. |
void |
resetToStylesheet(TransformSnapshot ts)
Deprecated. This is an internal tooling API that nobody seems to be using |
private void |
resetUserParameters()
Reset parameters that the user specified for the transformation. |
void |
run()
Run the transform thread. |
void |
runTransformThread()
Called by this.transform() if isParserEventsOnMain()==false. |
void |
runTransformThread(int priority)
Called by SourceTreeHandler to start the transformation in a separate thread NEEDSDOC @param priority |
static void |
runTransformThread(java.lang.Runnable runnable)
Called by CoRoutineSAXParser. |
void |
setBaseURLOfSource(java.lang.String base)
Get the base URL of the source. |
void |
setContentHandler(org.xml.sax.ContentHandler handler)
Set the content event handler. |
void |
setCurrentElement(ElemTemplateElement e)
Set the top of the current template elements stack. |
void |
setDebug(boolean b)
|
void |
setErrorListener(javax.xml.transform.ErrorListener listener)
Set the error event listener. |
void |
setExceptionThrown(java.lang.Exception e)
Set the exception thrown by the secondary thread (normally the transform thread). |
(package private) void |
setExtensionsTable(StylesheetRoot sroot)
If the stylesheet contains extensions, set the extensions table object. |
void |
setIsTransformDone(boolean done)
Set if the transform method is completed. |
void |
setOutputFormat(OutputProperties oformat)
Set the output properties for the transformation. |
void |
setOutputProperties(java.util.Properties oformat)
Set the output properties for the transformation. |
void |
setOutputProperty(java.lang.String name,
java.lang.String value)
This method is used to set or override the value of the effective xsl:output attribute values specified in the stylesheet. |
void |
setOutputTarget(javax.xml.transform.Result outputTarget)
Set the original output target. |
void |
setParameter(java.lang.String name,
java.lang.Object value)
Set a parameter for the transformation. |
void |
setParameter(java.lang.String name,
java.lang.String namespace,
java.lang.Object value)
Set a parameter for the templates. |
void |
setParameters(java.util.Properties params)
Set a bag of parameters for the transformation. |
void |
setProperty(java.lang.String property,
java.lang.Object value)
Set a runtime property for this TransformerImpl . |
void |
setQuietConflictWarnings(boolean b)
If the quietConflictWarnings property is set to true, warnings about pattern conflicts won't be printed to the diagnostics stream. |
void |
setRecursionLimit(int limit)
Set the recursion limit. |
void |
setSerializationHandler(SerializationHandler xoh)
|
void |
setShouldReset(boolean shouldReset)
NEEDSDOC Method setShouldReset NEEDSDOC @param shouldReset |
void |
setSourceTreeDocForThread(int doc)
This is just a way to set the document for run(). |
void |
setStylesheet(StylesheetRoot stylesheetRoot)
Set the stylesheet for this processor. |
void |
setTransformThread(java.lang.Thread t)
Get the thread that the transform process is on. |
void |
setURIResolver(javax.xml.transform.URIResolver resolver)
Set an object that will be used to resolve URIs used in document(), etc. |
void |
setXMLSource(javax.xml.transform.Source source)
Set the input source for the source tree, which is needed if the parse thread is not the main thread, in order for the parse thread's run method to get to the input source. |
void |
setXPathContext(XPathContext xcontext)
Set the execution context for XPath. |
void |
stopTransformation()
NEEDSDOC Method stopTransformation |
void |
transform(javax.xml.transform.Source source)
Process the source tree to SAX parse events. |
void |
transform(javax.xml.transform.Source source,
boolean shouldRelease)
Process the source tree to SAX parse events. |
void |
transform(javax.xml.transform.Source xmlSource,
javax.xml.transform.Result outputTarget)
Process the source tree to the output result. |
void |
transform(javax.xml.transform.Source xmlSource,
javax.xml.transform.Result outputTarget,
boolean shouldRelease)
Process the source tree to the output result. |
void |
transformNode(int node)
Process the source node to the output result, if the processor supports the "http://xml.org/trax/features/dom/input" feature. |
void |
transformNode(int node,
javax.xml.transform.Result outputTarget)
Process the source node to the output result, if the processor supports the "http://xml.org/trax/features/dom/input" feature. |
int |
transformToGlobalRTF(ElemTemplateElement templateParent)
Given a stylesheet element, create a result tree fragment from it's contents. |
int |
transformToRTF(ElemTemplateElement templateParent)
Given a stylesheet element, create a result tree fragment from it's contents. |
private int |
transformToRTF(ElemTemplateElement templateParent,
DTM dtmFrag)
Given a stylesheet element, create a result tree fragment from it's contents. |
java.lang.String |
transformToString(ElemTemplateElement elem)
Take the contents of a template element, process it, and convert it to a string. |
void |
waitTransformThread()
Used by SourceTreeHandler to wait until the transform completes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.Boolean m_reentryGuard
private java.io.FileOutputStream m_outputStream
private boolean m_parserEventsOnMain
private java.lang.Thread m_transformThread
private java.lang.String m_urlOfSource
private javax.xml.transform.Result m_outputTarget
private OutputProperties m_outputFormat
org.xml.sax.ContentHandler m_inputContentHandler
private org.xml.sax.ContentHandler m_outputContentHandler
javax.xml.parsers.DocumentBuilder m_docBuilder
private ObjectPool m_textResultHandlerObjectPool
private ObjectPool m_stringWriterObjectPool
private OutputProperties m_textformat
ObjectStack m_currentTemplateElements
java.util.Stack m_currentMatchTemplates
NodeVector m_currentMatchedNodes
private StylesheetRoot m_stylesheetRoot
private boolean m_quietConflictWarnings
private XPathContext m_xcontext
private StackGuard m_stackGuard
private SerializationHandler m_serializationHandler
private KeyManager m_keyManager
java.util.Stack m_attrSetStack
CountersTable m_countersTable
ElemNumber
BoolStack m_currentTemplateRuleIsNull
ObjectStack m_currentFuncResult
func:result
instruction that has been executed for the currently active EXSLT
func:function
private MsgMgr m_msgMgr
private boolean m_optimizer
private boolean m_incremental
private boolean m_source_location
private boolean m_debug
private javax.xml.transform.ErrorListener m_errorHandler
private TraceManager m_traceManager
private java.lang.Exception m_exceptionThrown
private javax.xml.transform.Source m_xmlSource
private int m_doc
private boolean m_isTransformDone
private boolean m_hasBeenReset
private boolean m_shouldReset
private java.util.Stack m_modes
private ExtensionsTable m_extensionsTable
private boolean m_hasTransformThreadErrorCatcher
java.util.Vector m_userParams
Constructor Detail |
---|
public TransformerImpl(StylesheetRoot stylesheet)
stylesheet
- The root of the stylesheet tree.Method Detail |
---|
public void setShouldReset(boolean shouldReset)
public ExtensionsTable getExtensionsTable()
void setExtensionsTable(StylesheetRoot sroot) throws javax.xml.transform.TransformerException
sroot
- The stylesheet.
javax.xml.transform.TransformerException
public boolean functionAvailable(java.lang.String ns, java.lang.String funcName) throws javax.xml.transform.TransformerException
ExtensionsProvider
functionAvailable
in interface ExtensionsProvider
javax.xml.transform.TransformerException
public boolean elementAvailable(java.lang.String ns, java.lang.String elemName) throws javax.xml.transform.TransformerException
ExtensionsProvider
elementAvailable
in interface ExtensionsProvider
javax.xml.transform.TransformerException
public java.lang.Object extFunction(java.lang.String ns, java.lang.String funcName, java.util.Vector argVec, java.lang.Object methodKey) throws javax.xml.transform.TransformerException
ExtensionsProvider
extFunction
in interface ExtensionsProvider
javax.xml.transform.TransformerException
public java.lang.Object extFunction(FuncExtFunction extFunction, java.util.Vector argVec) throws javax.xml.transform.TransformerException
ExtensionsProvider
extFunction
in interface ExtensionsProvider
javax.xml.transform.TransformerException
public void reset()
reset
in class javax.xml.transform.Transformer
public boolean getProperty(java.lang.String property)
getProperty
returns the current setting of the
property described by the property
argument.
%REVIEW% Obsolete now that source_location is handled in the TransformerFactory?
property
- a String
value
boolean
valuepublic void setProperty(java.lang.String property, java.lang.Object value)
TransformerImpl
.
%REVIEW% Obsolete now that source_location is handled in the TransformerFactory?
property
- a String
valuevalue
- an Object
valuepublic boolean isParserEventsOnMain()
public java.lang.Thread getTransformThread()
public void setTransformThread(java.lang.Thread t)
t
- The transform thread, may be null.public boolean hasTransformThreadErrorCatcher()
public void transform(javax.xml.transform.Source source) throws javax.xml.transform.TransformerException
source
- The input for the source tree.
javax.xml.transform.TransformerException
public void transform(javax.xml.transform.Source source, boolean shouldRelease) throws javax.xml.transform.TransformerException
source
- The input for the source tree.shouldRelease
- Flag indicating whether to release DTMManager.
javax.xml.transform.TransformerException
private void fatalError(java.lang.Throwable throwable) throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
public java.lang.String getBaseURLOfSource()
public void setBaseURLOfSource(java.lang.String base)
public javax.xml.transform.Result getOutputTarget()
public void setOutputTarget(javax.xml.transform.Result outputTarget)
public java.lang.String getOutputProperty(java.lang.String qnameString) throws java.lang.IllegalArgumentException
getOutputProperty
in class javax.xml.transform.Transformer
java.lang.IllegalArgumentException
- If the property is not supported.OutputKeys
public java.lang.String getOutputPropertyNoDefault(java.lang.String qnameString) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- If the property is not supported,
and is not namespaced.public void setOutputProperty(java.lang.String name, java.lang.String value) throws java.lang.IllegalArgumentException
The recognized standard output properties are:
For example:
tran.setOutputProperty("standalone", "yes");
In the case of the cdata-section-elements property, the value should be a whitespace separated list of element names. The element name is the local name of the element, if it is in no namespace, or, the URI in braces followed immediately by the local name if the element is in that namespace. For example:
tran.setOutputProperty( "cdata-section-elements", "elem1 {http://example.uri}elem2 elem3");
The recognized Xalan extension elements are:
These must be in the extension namespace of "http://xml.apache.org/xalan". This is accomplished by putting the namespace URI in braces before the property name, for example:
tran.setOutputProperty( "{http://xml.apache.org/xalan}line-separator" , "\n");
setOutputProperty
in class javax.xml.transform.Transformer
name
- The property name.value
- The requested value for the property.
java.lang.IllegalArgumentException
- if the property name is not legal.public void setOutputProperties(java.util.Properties oformat) throws java.lang.IllegalArgumentException
If argument to this function is null, any properties previously set will be removed.
setOutputProperties
in class javax.xml.transform.Transformer
oformat
- A set of output properties that will be
used to override any of the same properties in effect
for the transformation.
java.lang.IllegalArgumentException
- if any of the argument keys are not
recognized and are not namespace qualified.OutputKeys
,
Properties
public java.util.Properties getOutputProperties()
Note that mutation of the Properties object returned will not effect the properties that the transformation contains.
getOutputProperties
in class javax.xml.transform.Transformer
public SerializationHandler createSerializationHandler(javax.xml.transform.Result outputTarget) throws javax.xml.transform.TransformerException
outputTarget
- Where the transform result should go,
should not be null.
javax.xml.transform.TransformerException
public SerializationHandler createSerializationHandler(javax.xml.transform.Result outputTarget, OutputProperties format) throws javax.xml.transform.TransformerException
outputTarget
- Where the transform result should go,
should not be null.format
- The OutputProperties object that will contain
instructions on how to serialize the output.
javax.xml.transform.TransformerException
public void transform(javax.xml.transform.Source xmlSource, javax.xml.transform.Result outputTarget) throws javax.xml.transform.TransformerException
transform
in class javax.xml.transform.Transformer
xmlSource
- The input for the source tree.outputTarget
- The output source target.
javax.xml.transform.TransformerException
public void transform(javax.xml.transform.Source xmlSource, javax.xml.transform.Result outputTarget, boolean shouldRelease) throws javax.xml.transform.TransformerException
xmlSource
- The input for the source tree.outputTarget
- The output source target.shouldRelease
- Flag indicating whether to release DTMManager.
javax.xml.transform.TransformerException
public void transformNode(int node, javax.xml.transform.Result outputTarget) throws javax.xml.transform.TransformerException
node
- The input source node, which can be any valid DTM node.outputTarget
- The output source target.
javax.xml.transform.TransformerException
public void transformNode(int node) throws javax.xml.transform.TransformerException
node
- The input source node, which can be any valid DTM node.
javax.xml.transform.TransformerException
public org.xml.sax.ContentHandler getInputContentHandler()
public org.xml.sax.ContentHandler getInputContentHandler(boolean doDocFrag)
doDocFrag
- true if a DocumentFragment should be created as
the root, rather than a Document.
public org.xml.sax.ext.DeclHandler getInputDeclHandler()
public org.xml.sax.ext.LexicalHandler getInputLexicalHandler()
public void setOutputFormat(OutputProperties oformat)
oformat
- A valid OutputProperties object (which will
not be mutated), or null.public OutputProperties getOutputFormat()
public void setParameter(java.lang.String name, java.lang.String namespace, java.lang.Object value)
name
- The name of the parameter.namespace
- The namespace of the parameter.value
- The value object. This can be any valid Java object
-- it's up to the processor to provide the proper
coersion to the object, or simply pass it on for use
in extensions.public void setParameter(java.lang.String name, java.lang.Object value)
setParameter
in class javax.xml.transform.Transformer
name
- The name of the parameter,
which may have a namespace URI.value
- The value object. This can be any valid Java object
-- it's up to the processor to provide the proper
coersion to the object, or simply pass it on for use
in extensions.private void replaceOrPushUserParam(QName qname, XObject xval)
public java.lang.Object getParameter(java.lang.String name)
getParameter
in class javax.xml.transform.Transformer
private void resetUserParameters()
public void setParameters(java.util.Properties params)
public void clearParameters()
clearParameters
in class javax.xml.transform.Transformer
protected void pushGlobalVars(int contextNode) throws javax.xml.transform.TransformerException
If we encounter a variable that is already defined in the variable stack, we ignore it. This is because the second variable definition will be at a lower import precedence. Presumably, global"variables at the same import precedence with the same name will have been caught during the recompose process.
However, if we encounter a parameter that is already defined in the variable stack, we need to see if this is a parameter whose value was supplied by a setParameter call. If so, we need to "receive" the one already in the stack, ignoring this one. If it is just an earlier xsl:param or xsl:variable definition, we ignore it using the same reasoning as explained above for the variable.
contextNode
- The root of the source tree, can't be null.
javax.xml.transform.TransformerException
public void setURIResolver(javax.xml.transform.URIResolver resolver)
setURIResolver
in class javax.xml.transform.Transformer
resolver
- An object that implements the URIResolver interface,
or null.public javax.xml.transform.URIResolver getURIResolver()
getURIResolver
in class javax.xml.transform.Transformer
public void setContentHandler(org.xml.sax.ContentHandler handler)
java.lang.NullPointerException
- If the handler
is null.XMLReader.setContentHandler(org.xml.sax.ContentHandler)
public org.xml.sax.ContentHandler getContentHandler()
XMLReader.getContentHandler()
public int transformToRTF(ElemTemplateElement templateParent) throws javax.xml.transform.TransformerException
templateParent
- The template element that holds the fragment.
javax.xml.transform.TransformerException
public int transformToGlobalRTF(ElemTemplateElement templateParent) throws javax.xml.transform.TransformerException
templateParent
- The template element that holds the fragment.
javax.xml.transform.TransformerException
private int transformToRTF(ElemTemplateElement templateParent, DTM dtmFrag) throws javax.xml.transform.TransformerException
templateParent
- The template element that holds the fragment.dtmFrag
- The DTM to write the RTF into
javax.xml.transform.TransformerException
public ObjectPool getStringWriterPool()
public java.lang.String transformToString(ElemTemplateElement elem) throws javax.xml.transform.TransformerException
elem
- The parent element whose children will be output
as a string.
javax.xml.transform.TransformerException
public boolean applyTemplateToNode(ElemTemplateElement xslInstruction, ElemTemplate template, int child) throws javax.xml.transform.TransformerException
xslInstruction
- The calling element.template
- The template to use if xsl:for-each, current template for apply-imports, or null.child
- The source context node.
javax.xml.transform.TransformerException
public void executeChildTemplates(ElemTemplateElement elem, org.w3c.dom.Node context, QName mode, org.xml.sax.ContentHandler handler) throws javax.xml.transform.TransformerException
elem
- The ElemTemplateElement that contains the children
that should execute.
NEEDSDOC @param contextmode
- The current mode.handler
- The ContentHandler to where the result events
should be fed.
javax.xml.transform.TransformerException
public void executeChildTemplates(ElemTemplateElement elem, boolean shouldAddAttrs) throws javax.xml.transform.TransformerException
elem
- The ElemTemplateElement that contains the children
that should execute.shouldAddAttrs
- true if xsl:attributes should be executed.
javax.xml.transform.TransformerException
public void executeChildTemplates(ElemTemplateElement elem, org.xml.sax.ContentHandler handler) throws javax.xml.transform.TransformerException
elem
- The ElemTemplateElement that contains the children
that should execute.handler
- The ContentHandler to where the result events
should be fed.
javax.xml.transform.TransformerException
public java.util.Vector processSortKeys(ElemForEach foreach, int sourceNodeContext) throws javax.xml.transform.TransformerException
foreach
- Valid ElemForEach element, not null.sourceNodeContext
- The current node context in the source tree,
needed to evaluate the Attribute Value Templates.
javax.xml.transform.TransformerException
public java.util.Vector getElementCallstack()
public int getCurrentTemplateElementsCount()
public ObjectStack getCurrentTemplateElements()
public void pushElemTemplateElement(ElemTemplateElement elem)
elem
- The current ElemTemplateElement (may be null, and then
set via setCurrentElement).public void popElemTemplateElement()
public void setCurrentElement(ElemTemplateElement e)
e
- The current ElemTemplateElement about to
be executed.public ElemTemplateElement getCurrentElement()
public int getCurrentNode()
public java.util.Vector getTemplateCallstack()
public ElemTemplate getCurrentTemplate()
Please note that the ElemTemplate returned may be a default template, and thus may not have a template defined in the stylesheet.
public void pushPairCurrentMatched(ElemTemplateElement template, int child)
template
- xsl:template or xsl:for-each.child
- The child that was matched.public void popCurrentMatched()
public ElemTemplate getMatchedTemplate()
public int getMatchedNode()
public DTMIterator getContextNodeList()
public javax.xml.transform.Transformer getTransformer()
public void setStylesheet(StylesheetRoot stylesheetRoot)
stylesheetRoot
- A non-null StylesheetRoot object,
or null if you wish to clear the stylesheet reference.public final StylesheetRoot getStylesheet()
public boolean getQuietConflictWarnings()
public void setQuietConflictWarnings(boolean b)
b
- true if conflict warnings should be suppressed.public void setXPathContext(XPathContext xcontext)
xcontext
- A non-null reference to the XPathContext
associated with this transformer.public final XPathContext getXPathContext()
public StackGuard getStackGuard()
public int getRecursionLimit()
public void setRecursionLimit(int limit)
limit
- A number that represents the limit of recursion,
or -1 if no checking is to be done.public SerializationHandler getResultTreeHandler()
public SerializationHandler getSerializationHandler()
public KeyManager getKeyManager()
public boolean isRecursiveAttrSet(ElemAttributeSet attrSet)
attrSet
- A non-null ElemAttributeSet reference.
public void pushElemAttributeSet(ElemAttributeSet attrSet)
attrSet
- A non-null ElemAttributeSet reference.public void popElemAttributeSet()
public CountersTable getCountersTable()
public boolean currentTemplateRuleIsNull()
public void pushCurrentTemplateRuleIsNull(boolean b)
b
- True if the we are executing an xsl:for-each
(or xsl:call-template?).public void popCurrentTemplateRuleIsNull()
public void pushCurrentFuncResult(java.lang.Object val)
func:function
.
val
- the result of executing an EXSLT
func:result
instruction for the current
func:function
.public java.lang.Object popCurrentFuncResult()
func:function
.
func:function
public boolean currentFuncResultSeen()
func:result
instruction has been
executed for the currently active EXSLT func:function
.
true
if and only if a func:result
instruction has been executedpublic MsgMgr getMsgMgr()
public void setErrorListener(javax.xml.transform.ErrorListener listener) throws java.lang.IllegalArgumentException
setErrorListener
in class javax.xml.transform.Transformer
listener
- The new error listener.
java.lang.IllegalArgumentException
- ifpublic javax.xml.transform.ErrorListener getErrorListener()
getErrorListener
in class javax.xml.transform.Transformer
public TraceManager getTraceManager()
public boolean getFeature(java.lang.String name) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
The feature name is any fully-qualified URI. It is possible for an TransformerFactory to recognize a feature name but to be unable to return its value; this is especially true in the case of an adapter for a SAX1 Parser, which has no way of knowing whether the underlying parser is validating, for example.
name
- The feature name, which is a fully-qualified
URI.
org.xml.sax.SAXNotRecognizedException
- When the
TransformerFactory does not recognize the feature name.
org.xml.sax.SAXNotSupportedException
- When the
TransformerFactory recognizes the feature name but
cannot determine its value at this time.
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
public QName getMode()
public void pushMode(QName mode)
public void popMode()
public void runTransformThread(int priority)
public void runTransformThread()
public static void runTransformThread(java.lang.Runnable runnable)
public void waitTransformThread() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public java.lang.Exception getExceptionThrown()
public void setExceptionThrown(java.lang.Exception e)
e
- The thrown exception, or null if no exception was
thrown.public void setSourceTreeDocForThread(int doc)
doc
- A non-null reference to the root of the
tree to be transformed.public void setXMLSource(javax.xml.transform.Source source)
source
- The input source for the source tree.public boolean isTransformDone()
public void setIsTransformDone(boolean done)
done
- True if transformNode has completed, or
an exception was thrown.void postExceptionFromThread(java.lang.Exception e)
e
- The exception that was thrown.public void run()
run
in interface java.lang.Runnable
public TransformSnapshot getSnapshot()
public void executeFromSnapshot(TransformSnapshot ts) throws javax.xml.transform.TransformerException
ts
- The snapshot of where to start execution
javax.xml.transform.TransformerException
public void resetToStylesheet(TransformSnapshot ts)
ts
- The snapshot of where to start executionpublic void stopTransformation()
public short getShouldStripSpace(int elementHandle, DTM dtm)
DTM
. Normally, this function
will be called by the implementation of DTM
;
it is not normally called directly from
user code.
getShouldStripSpace
in interface DTMWSFilter
elementHandle
- int Handle of the element.
public void init(ToXMLSAXHandler h, javax.xml.transform.Transformer transformer, org.xml.sax.ContentHandler realHandler)
transformer
- non-null transformer instancerealHandler
- Content Handler instancepublic void setSerializationHandler(SerializationHandler xoh)
public void fireGenerateEvent(int eventType, char[] ch, int start, int length)
fireGenerateEvent
in interface SerializerTrace
eventType
- One of the EVENTTYPE_XXX constants.ch
- The char array from the SAX event.start
- The start offset to be used in the char array.length
- The end offset to be used in the chara array.SerializerTrace.fireGenerateEvent(int, char[], int, int)
public void fireGenerateEvent(int eventType, java.lang.String name, org.xml.sax.Attributes atts)
fireGenerateEvent
in interface SerializerTrace
eventType
- One of the EVENTTYPE_XXX constants.name
- The name of the element.atts
- The SAX attribute list.SerializerTrace.fireGenerateEvent(int, String, Attributes)
public void fireGenerateEvent(int eventType, java.lang.String name, java.lang.String data)
fireGenerateEvent
in interface SerializerTrace
eventType
- One of the EVENTTYPE_XXX constants.name
- The name of the processing instruction.data
- The processing instruction data.SerializerTrace.fireGenerateEvent(int, String, String)
public void fireGenerateEvent(int eventType, java.lang.String data)
fireGenerateEvent
in interface SerializerTrace
eventType
- One of the EVENTTYPE_XXX constants.data
- The comment or entity ref data.SerializerTrace.fireGenerateEvent(int, String)
public void fireGenerateEvent(int eventType)
fireGenerateEvent
in interface SerializerTrace
eventType
- One of the EVENTTYPE_XXX constants.SerializerTrace.fireGenerateEvent(int)
public boolean hasTraceListeners()
SerializerTrace
hasTraceListeners
in interface SerializerTrace
SerializerTrace.hasTraceListeners()
public boolean getDebug()
public void setDebug(boolean b)
public boolean getIncremental()
public boolean getOptimize()
public boolean getSource_location()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |