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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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

   
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.