Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Need help figuring out how to use exslt in stylesheet

From: "Karr, David" <david.karr@-------->
To:
Date: 10/31/2005 11:46:00 PM
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>
----------------


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent