Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] applying templates to a variable for endnotes

From: Cindy Mazza <clm6u@------------>
To:
Date: 7/23/2002 1:56:00 PM
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


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent