This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
applying templates to a variable for endnotes
- From: Cindy Mazza <clm6u at virginia dot edu>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 23 Jul 2002 17:57:09 -0400
- Subject: [xsl] applying templates to a variable for endnotes
- Organization: IATH
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi ,
I'm trying to create endnotes in a document. I have the following
structure in my XML:
<div1 id="d1.1">
<head lang="english">yyy</head>
<p lang="english">yyy <note id="n1">lalala</note></p>
<div2 id="d2.1">
<head lang="english">uuu</head>
<p lang="english">uuu <note id="n2">lalala</note></p>
<p lang="english">uuu <note id="n3">lalala</note></p>
</div2>
</div1>
I'm trying to gather the notes in each div1 and output them at the end
of the element in their own subsection (d2). I think I've got most of
it working - I'm getting the correct numbering and text when I output
them using 'xsl:value-of', but when I try to apply styles to it, I don't
get any of the text, just extra borders.
Can anyone tell what I'm doing wrong?
<xsl:template match="div1|div2|div3|div4|div5|div6">
<xsl:param name="doc.lang" select="$doc.lang"/>
<xsl:param name="text.size" select="$text.size"/>
<a name="{@id}"></a>
<xsl:apply-templates>
<xsl:with-param name="doc.lang"><xsl:value-of select="$doc.lang"/></xsl:with-param>
<xsl:with-param name="text.size"><xsl:value-of select="$text.size"/></xsl:with-param>
</xsl:apply-templates>
<!-- coding for notes -->
<xsl:if test="self::div1">
<xsl:variable name="div1id" select="@id"/>
<xsl:variable name="div1notes">
<xsl:element name="div2">
<xsl:attribute name="id"><xsl:value-of select="$div1id"/>.notes</xsl:attribute>
<xsl:element name="head">
<xsl:text>Notes</xsl:text>
</xsl:element>
<xsl:for-each select="descendant::note">
<xsl:number count="note" level="any" from="div1"/><xsl:text>. </xsl:text>
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:element>
</xsl:variable>
<!-- xsl:value-of gives me the correct textual information w/out -->
<!-- styles, but trying to use the xsl:apply-templates doesn't -->
<!-- give me any textual information at all -->
<!-- xsl:value-of select="$div1notes"/ -->
<xsl:apply-templates select="$div1notes"/>
</xsl:if>
</xsl:template>
Thanks,
-----
- Cindy
Cynthia L. Mazza
mailto:clm6u@virginia.edu
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list