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

Re: applying templates to a variable for endnotes

Subject: Re: applying templates to a variable for endnotes
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Thu, 25 Jul 2002 23:06:03 +0200
how to apply endnotes
Cindy Mazza wrote:
That gives me the text, but without any styles applied.


Ah, now I get the problem:
    <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:apply-templates select="$div1notes"/>

The variable "div1notes" is a RTF, you can't apply templates to it (check the spec for details). You can either apply templates during *building* the variable content and copy the variable into the result stream: <xsl:template match="note" mode="endnote"> <xsl:number count="note" level="any" from="div1"/><xsl:text>. </xsl:text> <xsl:apply-templates> </xsl:template > ...

     <xsl:variable name="div1notes">
        <div id="{$div1id}.notes>
           <!-- do whatever you do with "head" here -->
           <xsl:apply-templates select="descendant::note" mode="endnote"/>
        <div>
     </xsl:variable>
   ...
   <xsl:copy-of select="$div1notes"/>

The other possibility is to use an extension function which
converts the RTF to a node set. The details are processor
dependent, look into the documentation of your processor.
If you use MSXML, you'll have to resort to some embedded
script, check the archives of this list.

     <xsl:variable name="div1notes">
          ...
     </xsl:variable>

<xsl:apply-templates select="nn:node-set($div1notes)"/>

J.Pietschmann


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.