Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 14th, 2015, 02:31 AM
Registered User
 
Join Date: Apr 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error only on using xalan:evaluate - error Could not compile stylesheet

XSL does not compile when and only I use xalan:evaluate.

Setting in system properties
----------------------------

sysProps.setProperty("javax.xml.transform.Transfor merFactory", "org.apache.xalan.xsltc.trax.SmartTransformerFacto ryImpl");

XSLT snippet
--------------

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="xalan">

<xsl:template name="my_test_template">
<xsl:param name="my_test_param" />

<xsl:if test="xalan:evaluate($my_test_param)">
some statements
</xsl:if>

<xsl:if test="not(xalan:evaluate($my_test_param))">
some statements
</xsl:if>

</xsl:template>

ERROR LOG
-----------------------------------------------

ERROR: 'Cannot find external method 'org.apache.xalan.lib.Extensions.evaluate' (must be public).'
2015-04-14 08:19:52,509 XslTransform ERROR> Error creating 16 template, will skip compile and use interpretive mode instead
javax.xml.transform.TransformerConfigurationExcept ion: Could not compile stylesheet
at org.apache.xalan.xsltc.trax.TransformerFactoryImpl .newTemplates(TransformerFactoryImpl.java:832)
at org.apache.xalan.xsltc.trax.SmartTransformerFactor yImpl.newTemplates(SmartTransformerFactoryImpl.jav a:319)
 
Old April 14th, 2015, 06:55 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

According to the Xalan documentation http://xalan.apache.org/xalan-j/extensions_xsltc.html I don't see any support in XSLTC for xalan: evaluate, that seems to be only supported in the Xalan interpreter XSLT implementation http://xalan.apache.org/xalan-j/extensionslib.html. So you will need to use a different transformer. In the Java world you might also consider to switch to Saxon 9 as it supports XSLT 2.0 and 3.0 while Xalan is an XSLT 1.0 processor.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Decipher Compile error: Syntax error Charlie07 BOOK: Excel VBA 24-Hour Trainer 1 August 23rd, 2013 10:07 AM
outofmemory error with xalan alapati.sasi XSLT 1 August 18th, 2009 01:25 PM
Error "Failed to compile stylesheet" amhicraig XSLT 1 December 7th, 2007 07:20 PM
Compile error: Syntax error: & Else without HELP Corey VB How-To 2 April 21st, 2006 03:25 PM
Firefox says "Error loading stylesheet: (null)" biolizard89 XSLT 2 July 7th, 2005 11:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.