Function-available() currently has a problem detecting extension functions
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14149). Although
function-available does not return a correct value, you can still use all
supported extension functions directly.
For question 2, this usage is generally OK. I am not sure whether
str:replace template will work correctly with Xalan. The only way you can
tell is to try it out and see if it gives you the correct result.
Regards,
Morris Kwan
XSLT Development
IBM Toronto Lab
Tel: (905)413-3729
Email: [EMAIL PROTECTED]
Ashok Natesan
<[EMAIL PROTECTED] To: "'[EMAIL PROTECTED]'"
<[EMAIL PROTECTED]>
oop.com> cc:
Subject: Newbie questions: How
do I get to EXSLT functionality in XALAN?
04/06/2003 02:14
PM
Two questions:
1) I'm using xalan-j_2_5_D1 on Win2K
I am trying to use the EXSLT functions - the str XSL functions in
particular. I am not having much luck with XALAN
recognizing any of the "exsl:xyz" or "str:xyz" references
After reading the doc on Extensions and Extension Libraray, I have in my
CLASSPATH: xalan.jar; xml-apis.jar; xercesImpl.jar, bsf.jar (where is
js.jar, btw?). Do I need anything else in the my classpath? or anything in
some config area?
I wrote the xsl test script below.. The ONLY function that reports its
available is "xalan:nodeset". None of the other functions below are found.
This is probably something really silly I'm overlooking. Any help would be
appreciated.
2) Also, assuming I get past the above problem.. Reading through the xalan
EXSLT support docs, it appears that str:replace in particular is not yet
supported natively in xalan. I am planning on copying over
str.replace.template.xsl from the EXSLT str.zip to the dir containing my
other XSL scripts and importing it as follows.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="str">
<xsl:import href="str/functions/replace/str.replace.template.xsl" />
<<< Use the str:replace function here >>>
Is this the right way? Or is there a better approach? Thx.
Ashok
==============================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
xmlns:math="http://exslt.org/math"
xmlns:exsl="http://exslt.org/common"
xmlns:xalan="http://xml.apache.org/xalan"
exclude-result-prefixes="xalan"
extension-element-prefixes="str exsl">
<xsl:template match="/">
<xsl:if test="function-available('exsl:node-set')">
<xsl:message>
Function Available ('exsl:node-set')
</xsl:message>
</xsl:if>
<xsl:if test="function-available('xalan:nodeset')">
<xsl:message>
Function Available ('xalan:nodeset')
</xsl:message>
</xsl:if>
<xsl:if test="function-available('math:min')">
<xsl:message>
Function Available ('math:min')
</xsl:message>
</xsl:if>
<xsl:if test="function-available('str:split')">
<xsl:message>
Function Available ('str:split')
</xsl:message>
</xsl:if>
<xsl:if test="function-available('xalan:split')">
<xsl:message>
Function Available ('str:replace')
</xsl:message>
</xsl:if>
</xsl:template>
</xsl:stylesheet>