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

applying templates to a variable for endnotes

Subject: applying templates to a variable for endnotes
From: Cindy Mazza <clm6u@xxxxxxxxxxxx>
Date: Tue, 23 Jul 2002 17:57:09 -0400
xsl applying template variable
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@xxxxxxxxxxxx


 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.