Re: [xsl] What is exciting in XSLT 2.0 (Was: Re: [xsl] parameters in XSLT 2.0)

Subject: Re: [xsl] What is exciting in XSLT 2.0 (Was: Re: [xsl] parameters in XSLT 2.0)
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 08 Jun 2005 13:38:18 +0100
>>>>> "James" == James Fuller <jim.fuller@xxxxxxxxxxxxxx> writes:


    James> BTW what is the current interaction of compiled stylesheets and XSLT 2.0...

XSLT 2.0 (like XSLT 1.0) does not define "compiled stylesheets". It
only deals with stylesheets written as source text.

So this question should properly be directed at a particular
implementation (if I am understanding you correctly).

    James> also can an XSLT 2.0 just have xsl:function definitions aka;

    James> <xsl:transform
    James> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    James> xmlns:xs="http://www.w3.org/2001/XMLSchema";
    James> xmlns:str="http://example.com/namespace"; version="2.0"
    James> exclude-result-prefixes="str">

    James> <xsl:function name="str:reverse" as="xs:string"> <xsl:param
    James> name="sentence" as="xs:string"/> <xsl:sequence select="if
    James> (contains($sentence, ' ')) then
    James> concat(str:reverse(substring-after($sentence, ' ')), ' ',
    James> substring-before($sentence, ' ')) else $sentence"/>
    James> </xsl:function>

    James> </xsl:transform>


    James> so libraries can be built up?

Yes.

This is a stylesheet (module) that has only built-in templates, and
so, if invoked as the principal stylesheet, will not call the
function.

But if included or imported into another stylesheet, then indeed the
function might be called from other templates.
-- 
Colin Adams
Preston Lancashire

Current Thread