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

Re: multiple template value input

Subject: Re: multiple template value input
From: clemens schrenk <clemens.schrenk@xxxxxxx>
Date: Thu, 18 Sep 2003 17:30:16 +0200
xsl template multiple
>> 
> More than likely you would be "handing" them to a template, rather that
> an "x-path function".  In any event, it would be best if you explained
> what you want to accomplish.  It can probably be done better and more
> easily in some other way, but we need more information.
> 
> Cheers,
> 
> Tom P
> 
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

....that's right: 

my task is as follows, fully explained:


this template gets the contents of an element which occur more than once:

<xsl:template match="INSTANCE" name="joseph">
   <xsl:for-each select="key('tracker', 'Referenced Document')">
        <xsl:copy-of
select="substring-before(substring-after(.,'&quot;\&quot;'), '&quot;')"/>
   </xsl:for-each>
</xsl:template>


i try to hand these over to a variable first:

<xsl:variable name="frank">
<xsl:call-template name="joseph">
</xsl:call-template>
</xsl:variable>

and finally i want to put in the variable in the following replace function,
which is within another template...:

<xsl:template match="ATTRIBUTE" name="koarl">
        <xsl:call-template name="replace-string">
            <xsl:with-param name="text" select="$frank"/>
            <xsl:with-param name="from" select="'\\'"/>
            <xsl:with-param name="to" select="'\'"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="replace-string">
        <xsl:param name="text"/>
        <xsl:param name="from"/>
        <xsl:param name="to"/>
        <xsl:choose>
            <xsl:when test="contains($text, $from)">
                <xsl:variable name="before" select="substring-before($text,
$from)"/>
                <xsl:variable name="after" select="substring-after($text,
$from)"/>
                <xsl:variable name="prefix" select="concat($before, $to)"/>
                <xsl:value-of select="$before"/>
                <xsl:value-of select="$to"/>
                <xsl:call-template name="replace-string">
                    <xsl:with-param name="text" select="$after"/>
                    <xsl:with-param name="from" select="$from"/>
                    <xsl:with-param name="to" select="$to"/>
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="$text"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

all of these work perfectly, except the variable "frank" that is put in as
the outcomes of all the for-each loops in the first template put together...


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.