 |
| 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
|
|
|
|

March 2nd, 2011, 07:07 AM
|
|
Authorized User
|
|
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
|
|
footnote paste end of the file
Hi,
In xml footnote is present inside paragraph. my xslt coding working but i want to paste footnote at end of the file. Now footnote text are pasted footnote number near.
Please consider the below pasted sample for your reference.
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
<p>The text <sup>1</sup> text continue<sup>2</sup></p>
<footnote>1. footnote text 1</footnote>
<footnote>2. footnote text 2</footnote>
XSL coding
<xsl:template match="//footnote/p/ptext">
<span><xsl:value-of select="."/></span>
</xsl:template>
<xsl:template match="//footnote/label">
<sup><xsl:value-of select="."/></sup>
</xsl:template>
Kindly give us sollution for this.
Thanks and Regards,
Rockbal
|
|

March 2nd, 2011, 07:12 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
|
|
Use a different mode (e.g. template match="footnote/p/ptext" mode="appendix", apply-templates select="//footenote/p/ptext" mode="appendix") for ensuring you output the footnote text at the end of your result document.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
|
|

March 3rd, 2011, 07:23 AM
|
|
Authorized User
|
|
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi,
The below xsl code i used for your suggestion, but i can't get footnote at end of the document.
XSL Coding
<xsl:template match="footnote" mode="appendix">
<p><xsl:apply-templates select="footnote" mode="appendix"></xsl:apply-templates></p>
</xsl:template>
Kindly suggest for this.
|
|

March 3rd, 2011, 07:33 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
You would have a normal template to handle footnotes in the text something like this:
Code:
<xsl:template match="footnote">
<sup><xsl:value-of select="label">/></sup></xsl:template>
Then another template for the same element, but a different mode:
Code:
<xsl:template match="footnote" mode="appendix">
<footnote><xsl:value-of select="label"> <xsl:value-of select="ptext"></footnote>
</xsl:template>
Then, at the end of your normal document where you want the footnotes to appear simply insert this:
Code:
<xsl:apply-templates select="//footnote" mode="appendix"/>
|
|

March 3rd, 2011, 07:50 AM
|
|
Authorized User
|
|
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi,
I want all footnote in end of the document. i use for three coding. but i can't get at the end of the document.
Kindly suggest.
Regards,
Rockbal
|
|

March 3rd, 2011, 07:54 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
Of course you can - you have complete control over how the output document is being written.
You must have a main template, or a root template e.g. <xsl:template match="/">
Just put the code I mention above at the end of that template and it will appear at the end of your document.
|
|

March 3rd, 2011, 08:40 AM
|
|
Authorized User
|
|
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi Its working fine.
Thanks lot.
Regards,
Rockbal
|
|

March 7th, 2011, 09:13 AM
|
|
Authorized User
|
|
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi samjudson,
It working fine, but the footnote text occured two places. one for bottom of the document another one is within paragraph appear footnote text. i want to footnote label not footnote text within partagraph.
Kindly look at this.
Regards,
Rockbal
|
|

March 7th, 2011, 09:18 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
Well this will be because there is an error in your XSLT.
Please show us your XSLT and we may be able to help us further.
|
|
 |