[xep-support] xsl:for-each within xsl:variable

From: Matthew Richardson <matvey@umich.edu>
Date: Wed Jul 20 2005 - 07:28:10 PDT

I'm having an odd display problem with a stylesheet of mine and wondered if
anyone on the list could point out what I'm doing wrong. I have a
repeateable element that I transform into a comma-delimited list. My first
callout looks like this:

<xsl:apply-templates select="keyword[1]" />

And that template looks like this:

<xsl:template match="keyword">
        <xsl:variable name="content2">
                <xsl:for-each select="../keyword">
                        <xsl:value-of select="." /><xsl:if test="position()!=last()">, </xsl:if>
                </xsl:for-each>
        </xsl:variable>
        <xsl:call-template name="display1">
                <xsl:with-param name="label" select="'Keyword(s):'" />
                <xsl:with-param name="content" select="$content2" />
        </xsl:call-template>
</xsl:template>

The $content2 variable gets set to the first instance of keyword only. It
doesn't seem to be executing the xsl:for-each. This is confusing because
this same code worked just fine under FOP (i.e, that's why I'm asking this
list). I structured it this way because I want the lable "Subject Term(s):"
to appear once, not once for each keyword.

The display1 template just turns it into a two-column table row; that's
working fine. Is there something I'm missing here? Any suggestions?

Matthew A. Richardson
Inter-university Consortium for Political and Social Research
Phone: 734.615.7901
Email: matvey@umich.edu
"Everything tires with time, and starts to seek some opposition,
to save it from itself." --Clive Barker, The Hellbound Heart
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Wed Jul 20 07:52:40 2005

This archive was generated by hypermail 2.1.8 : Wed Jul 20 2005 - 07:52:42 PDT