Thomas Bijon wrote:
> I want to use the saxon extention : saxon:evaluate() in stylesheet that
> is run from the XXE transform process command.
>  
> I have declared the extention namespace as following :
> xmlns:saxon="http://icl.com/saxon";  
> extension-element-prefixes="saxon"   version="1.0"
>  
> But it does not work, I have the following error message :
> Failed to parse stylsheet :
> com.icl.saxon.PreparedStyleSheet.prepare(PreparedStyleSheet.java:117)
> com.icl.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:120)
> com.xmlmind.xmleditapp.process.StyleSheetCache.newTrasnformer(StyleSheetCache.java:58)
> com.xmlmind.xmleditapp.process.TransformItem.doExecute(TransformItem.java:181)
> com.xmlmind.xmleditapp.process.TransformItem.execute(TransformItem.java:123)
> com.xmlmind.xmleditapp.process.ProcessCommand$1.run(ProcessComman.java:179)
> fatal Error : Error reported by XML parser

You probably made a syntax error when you have modified the source of
the XSLT style sheet.

To be sure, I've modified
XXE_install_dir/addon/config/docbook/xsl/html/verbatim.xsl as follows
and there is no problem at all.

---
<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:sverb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Verbatim";
xmlns:xverb="com.nwalsh.xalan.Verbatim"
xmlns:lxslt="http://xml.apache.org/xslt";
xmlns:exsl="http://exslt.org/common";
xmlns:saxon="http://icl.com/saxon"; <---***
exclude-result-prefixes="saxon sverb xverb lxslt exsl" <---***
version='1.0'>

<xsl:template match="programlisting|screen|synopsis">
  <xsl:param name="suppress-numbers" select="'0'"/>
  <xsl:variable name="id">
    <xsl:call-template name="object.id"/>
  </xsl:variable>

  <xsl:call-template name="anchor"/>

  <xsl:if test="$shade.verbatim != 0">
    <xsl:message>
      <xsl:text>The shade.verbatim parameter is deprecated. </xsl:text>
      <xsl:text>Use CSS instead,</xsl:text>
    </xsl:message>
    <xsl:message>
      <xsl:text>for example: pre.</xsl:text>
      <xsl:value-of select="local-name(.)"/>
      <xsl:text> { background-color: #E0E0E0; }</xsl:text>
    </xsl:message>
  </xsl:if>

  ...

  <xsl:choose>
    <xsl:when test="$suppress-numbers = '0'
                    and @linenumbering = 'numbered'
                    and $use.extensions != '0'
                    and $linenumbering.extension != '0'">
      <xsl:variable name="rtf">
        <xsl:apply-templates/>
      </xsl:variable>
      <pre class="{name(.)}">
        <xsl:call-template name="number.rtf.lines">
          <xsl:with-param name="rtf" select="$rtf"/>
        </xsl:call-template>
      </pre>
    </xsl:when>
    <xsl:otherwise>
      <pre class="{name(.)}">
        <!--<xsl:apply-templates/>--> <---***
        <xsl:value-of select="saxon:evaluate('2 + 2')"/> <---***
      </pre>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

  ...
---

> Does any one has used successfully the saxon extention ?

It works fine, even *custom* Saxon extensions written by Norman Walsh.

> How can I know the saxon version used by XXE ?

Always the latest 6.5.x. Currently Saxon 6.5.5.

Reply via email to