|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: multiple template value input
>>
> 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(.,'"\"'), '"')"/>
</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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








