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 March 2nd, 2011, 07:07 AM
Authorized User
 
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default 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
 
Old March 2nd, 2011, 07:12 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

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
 
Old March 3rd, 2011, 07:23 AM
Authorized User
 
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default

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.
 
Old March 3rd, 2011, 07:33 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

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"/>
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old March 3rd, 2011, 07:50 AM
Authorized User
 
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
 
Old March 3rd, 2011, 07:54 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

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.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old March 3rd, 2011, 08:40 AM
Authorized User
 
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Its working fine.

Thanks lot.

Regards,
Rockbal
 
Old March 7th, 2011, 09:13 AM
Authorized User
 
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
 
Old March 7th, 2011, 09:18 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

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.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?





Similar Threads
Thread Thread Starter Forum Replies Last Post
footnote RockBal XSLT 1 February 28th, 2011 08:47 AM
Oracle back-end MS-Access 2003 client front-end Corey Access 2 February 16th, 2007 08:31 AM
Unexpected end of file while parsing... anup_daware C# 1 February 7th, 2007 05:14 AM
unexpected end of file Spivonious Visual C++ 2 September 21st, 2004 07:44 AM
unexpected end of file question Spivonious C++ Programming 4 September 15th, 2004 02:24 AM





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