XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
John AnnieSubject: Using EXSLT str:tokenize function
Author: John Annie
Date: 16 Oct 2007 12:59 PM
Folks,
I'm very new to XSL programming and have been given the task of modifying a XSLT file created by another individual using an editor/processor other than Stylus Studio. This problem deals with getting an EXSLT Function (str:tokenize) to work in Stylus Studio Pro 2007 using the built in processor. I'm getting the following error from line 90 of the attached XSLT file:

strTest.xsl (90, 5): Exception calling Java extension: ;
java.lang.ClassNotFoundException: http:..exslt.org.strings;
at com.exln.stylus.CXClassLoader.findClass(CXClassLoader.java:204);
at java.lang.ClassLoader.loadClass(Unknown Source);
at com.exln.stylus.CXClassLoader.loadClass(CXClassLoader.java:246);
at java.lang.ClassLoader.loadClass(Unknown Source); in expression

I know this has been addressed before, as I've searched the forum for a solution, but my lack of experience and understanding have prevented me putting the advice given in the forum to workable code. Iíve attached a copy of the offending code extracted from the program. Can someone offer some detailed instructions for fixing this problem?

Thanks

John Annie


DocumentstrTest.xsl
File containing str:tokenize function

Postnext
Ivan PedruzziSubject: Using EXSLT str:tokenize function
Author: Ivan Pedruzzi
Date: 16 Oct 2007 03:24 PM

Hi John,

The Stylus Studio built-in processor doesn't support EXSLT, you have tp switch to Java built-in or Saxon.

The switch processor see the online documentation.

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Postnext
John AnnieSubject: Using EXSLT str:tokenize function
Author: John Annie
Date: 16 Oct 2007 04:06 PM
Ivan,
Thanks for your speedy reply. Here's where my inexperience shows. The "java built-in" processor worked, however it doesn't allow for debugging, which I desperately need. So I tried the Saxon 8.9.0.3 processor and received the following error which again is on the str:tokenize statement.

strTest.xsl (90, 1): Error: on line 90 of file:///d:/DOCUME~1/fz6ppg/MYDOCU~1/JSSEO/RHAPSO~2/RHAPSO~1/strTest.xsl:;
Cannot find a matching 2-argument function named {http://exslt.org/strings}tokenize();

Is their a different syntax for the str:tokenize function using the Saxon processor?

Thanks!
John


Note: When I reduced the size of the xsl file to focus just on the str:tokenize code, I went too far and removed a global variable that needs to be included in the code. Here's the statement thatís needed to be added: <xsl:variable name="NOT_MAPPED">NOT_MAPPED_IN_I3</xsl:variable>

I corrected this in the attached strTest.xsl file. (Sorry about that).


DocumentstrTest(1).xsl
Corrected strTest.xsl file

Postnext
Ivan PedruzziSubject: Using EXSLT str:tokenize function
Author: Ivan Pedruzzi
Date: 16 Oct 2007 04:35 PM

Right, Saxon 8.x dropped support for EXSLT functions that overlap with XSLT/XPath 2.0 therefore you simply do

<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<root>
<xsl:for-each select="tokenize('a,b', ',')">
<token value="{.}"/>
</xsl:for-each>
</root>
</xsl:template>
</xsl:stylesheet>

<?xml version='1.0' ?>
<root><token value="a"/><token value="b"/></root>

Hope this helps

Posttop
John AnnieSubject: Using EXSLT str:tokenize function
Author: John Annie
Date: 17 Oct 2007 08:38 AM
That did it!

Thanks Ivan!

John

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.