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

Extract footnotes

Subject: Extract footnotes
From: "J. S. Rawat" <jrawat@xxxxxxxxxxxxxx>
Date: Sat, 03 Nov 2007 12:24:37 +0530
 Extract footnotes
Hi all
Can anybody let me know how to extract "footnote" from paragraph and write it to end of the section. Below is what I am trying to do


Input
<section>
<para>111...<footnote label="1" id="f1"><para>First fnt</para></footnote> 222... <footnote label="2" id="f2"><para>second fnt</para></footnote> </para>
<para>333...<footnote label="3" id="f3"><para>Third fnt</para></footnote> ...</para>
</section>


Required Output
<level>
<para>111....222 ....  </para>
<para>333... ...</para>
<footnote label="1" id="f1"><para>First fnt</para></footnote>
<footnote label="2" id="f2"><para>second fnt</para></footnote>
<footnote label="3" id="f3"><para>Third fnt</para></footnote>
</level>

<xsl:template match="section">
<level>
<xsl:apply-templates/>
<xsl:if test="descendant::*[self::footnote]">
<xsl:apply-templates select="descendant::*[self::section//footnote]"/>
</xsl:if>
</level>
</xsl:template>

<xsl:template match="para">
<xsl:copy>
<xsl:apply-templates select="descendant::*[not(self::footnote)]"/>
</xsl:copy>
</xsl:template>

thanks
...JSR

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.