loading table of contents...

2.8.4. org.docma.plugin.examples.XSLTAutoFormat

Arguments:
script=ALIAS
The alias name of the XSLT script. The prefix script= is optional.
factory=JAVA_CLASS_NAME
The Java classname of TransformerFactory to be used. The class has to implement the javax.xml.transform.TransformerFactory interface. The argument is optional. If no classname is specified, then the default TransformerFactory implementation is used.
Description:
The XSLT script identified by alias name ALIAS is applied to the input-element. If the factory argument is missing, then default TransformerFactory implementation is used. Note that the platform's default TransformerFactory implementation can be changed by setting the system property javax.xml.transform.TransformerFactory.
Example:
The Auto-Format configuration
    org.docma.plugin.examples.XSLTAutoFormat notebox_xslt 
is identical to
  org.docma.plugin.examples.XSLTAutoFormat script=notebox_xslt 
If this Auto-Format configuration is assigned to a style with ID notebox, and if the content-node with alias "notebox_xslt" contains following XSLT script:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                version="1.0">

  <xsl:output method="xml"/>
  
  <xsl:template match="/*">
      <table>
        <tr><td><xsl:value-of select="@title" /></td></tr>
        <tr><td><xsl:apply-templates/></td></tr>
      </table>
  </xsl:template>

  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>	
then the XHTML content
<div class="notebox" title="Some title">
  The content of the block.
</div> 
is rendered as
<table>
  <tr><td>Note: Some title</td></tr>
  <tr><td>The content of the block.</td></tr>
</table>  
In the following example the implementation of the XSLT processor is explicitely selected by passing the factory argument:
    org.docma.plugin.examples.XSLTAutoFormat 
          script=notebox_xslt 
          factory=org.apache.xalan.processor.TransformerFactoryImpl