[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Need help figuring out how to use exslt in stylesheet

Subject: Need help figuring out how to use exslt in stylesheet
From: "Karr, David" <david.karr@xxxxxxxx>
Date: Mon, 31 Oct 2005 15:45:09 -0800
how to use exslt
I'm sure something I'm doing is completely misguided, but I'm still
experimenting here.

I'm trying to figure out how to have a stylesheet use the EXSLT library.
I'm also doing this inside Stylus Studio, which might complicate things.

I copied the entire exslt tree to the directory where I have my
stylesheet (probably overkill).  I have an "xsl:import" for
"exslt/str/str.xsl".  I have a root template that calls a sub-template,
passing a parameter.  The sub-template tries to call "str:tokenize" and
put the result into a variable.

When I try to run the test on my sample data, I get an error:

-------
TransformerException: misplaced literal result in a func:function
container.
URL: file:.../exslt/str/functions/tokenize/str.tokenize.function.xsl
Line: 40
Col: 17
-------

Line 40 is the end tag of the "func:function" element defining
"str:tokenize".

I have the processor set to xalan-j 2.5.2.

My xslt is just this:
--------------------
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0"
                xmlns:str="http://exslt.org/str"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				extension-element-prefixes="str">
	<xsl:import href="exslt/str/str.xsl"/>
	<xsl:template match="/">
		<addressData>
			<complexAddress>
				<xsl:call-template
name="extractAddress">
					<xsl:with-param
name="simpleAddress" select="addressData/simpleAddress"/>
				</xsl:call-template>
			</complexAddress>
		</addressData>
	</xsl:template>
	<xsl:template name="extractAddress">
		<xsl:param name="simpleAddress"/>
		<xsl:variable name="tokens"
select="str:tokenize($simpleAddress)"/>
		<streetAddress>$tokens[0]</streetAddress>
		<city>$tokens[1]</city>
		<state>$tokens[2]</state>
		<zip>$tokens[3]</zip>
	</xsl:template>
</xsl:stylesheet>
----------------

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.