W-Beans for XML

com.oldlight.weaver.weaverbeans.xml
Class XTransformBean

java.lang.Object
  extended bycom.oldlight.weaver.weaverbeans.xml.XTransformBean

public class XTransformBean
extends Object

The XTransformBean W-Bean applies an XSLT stylesheet to an XML document. The result of the transformation is stored in a scoped attribute (as a DOM tree or an XML string). This is primarily useful to generate HTML from XML data generated by an application. The bean may also be used to convert a DOM tree in to a String by ommiting the specification of an XSLT stylesheet.

Author:
Paul Harvey
WBean Parameters
NameScopeClassMandatoryComment
xmlbeanString,Reader,InputStreamYesThe XML to transform. This attribute may evaluate to a java.io.Reader, to a java.io.InputStream or to a String. If the value is a Reader or an InputStream then its content is read. If the value is a String and it begins with "file://" then the remainder of the value is assumed to be the path to a file containing the XML, otherwise the String is assumed to contain the XML itself.
xsltbeanString,Reader,InputStreamNoThe XSLT styesheet to apply. This attribute may evaluate to a java.io.Reader, to a java.io.InputStream or to a String. If the value is a Reader or an InputStream then its content is read. If the value is a String and it begins with "file://" then the remainder of the value is assumed to be the path to a file containing the stylesheet, otherwise the String is assumed to contain the stylesheet itself. If the xslt attribute is not specificed then a null transformation is applied - this is useful to convert a DOM tree in to its String representation.
typebeanjava.lang.StringYesIndicates how to treat the result of the transformation. This must be one of: dom indicating that the result of the transformation should be stored as a DOM tree in the attribute indicated by var and scope or string indicating that the result of the transofrmation should be stored as a String in the attribute indicated by var and scope.
varbeanjava.lang.StringYesThe name of the attribute in which to store the result of the transformation.
scopebeanjava.lang.StringNoThe scope of the attribute in which to store the result of the transformation, defaults to local scope.

To use in your wad.xml import as follows:

<load-beans>
...
   <bean name="CHOOSE_A_NAME" class="com.oldlight.weaver.weaverbeans.xml.XTransformBean"/>
...
</load-beans>

Constructor Summary
XTransformBean()
           
 
Method Summary
 void handle(WeaverExecutionContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XTransformBean

public XTransformBean()
Method Detail

handle

public void handle(WeaverExecutionContext context)
            throws WeaverClientException
Throws:
WeaverClientException

Copyright ©Paul Harvey