xsl-list
[Top] [All Lists]

Need help figuring out how to use exslt in stylesheet

2005-10-31 16:45:09
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>
----------------

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>