Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 28th, 2011, 08:42 AM
Authorized User
 
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default footnote

Hi,

In xml footnote is present inside paragraph. i want footnote number viewed in super script by using xslt.

XML Coding

<p>The text <footnote id="1"><label>1</label><ptext>footnote text 1</ptext></footnote> text continue <footnote id="2"><label>2</label><ptext>footnote text 2</ptext></footnote></p>

Required Html
<sup>1</sup> <ftext>footnote text1</ftext>
 
Old February 28th, 2011, 08:47 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Code:
<xsl:template match="@* | node()">
  <xsl:copy>
     <xsl:apply-templates select="@* | node()"/>
  </xsl:copy>
</xsl:template>

<xsl:template match="footnote">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="footnote/label">
  <sup>
    <xsl:apply-templates/>
  </sup>
</xsl:template>

<xsl:template match="footnote/ptext">
  <ftext>
    <xsl:apply-templates/>
  </ftext>
</xsl:template>
should give you an idea.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.