XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2016)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Posttop
Rakesh KeerthiSubject: getting different instances of footnotes
Author: Rakesh Keerthi
Date: 07 May 2014 10:33 AM
I've the below cases in my XML.

<main>
<para num="1.12.10">
since no <page num="138"/>principal.
<footnoteref linkend="fn855" num="855"/><footnote num="855" id="fn855" number-type="arabic"></footnote>
</para>
<para num="1.12.11">
In other pl<footnoteref linkend="fn857" num="857"/>
<footnote num="857" id="fn857" number-type="arabic">
</footnote>short of the fraud of the agent.
<footnoteref linkend="fn860" num="860"/>
<footnote num="860" id="fn860" number-type="arabic"></footnote><footnoteref linkend="fn861" num="861"/><footnote num="861" id="fn861" number-type="arabic">
<para>At [8-209].</para>
</footnote>
</para>
<para num="1.12.12">
Indeed, in some non-property cases such as
<footnoteref linkend="fn862" num="862"/>
<footnote num="862" id="fn862" number-type="arabic">
<para>
<case>[1896] 2 Ch 743</case>.
</para>
</footnote>
</para>
</main>
and from footnotes template I use the below.

<xsl:if test="preceding::page[1]">
<xsl:variable name="op">&#60;</xsl:variable>
<xsl:variable name="apos">'</xsl:variable>
<xsl:variable name="cl">&#62;</xsl:variable>

<xsl:value-of select="concat($op,'?pb label=',$apos,preceding::page[1]/@num,$apos,'?',$cl)"/>

</xsl:if>
and i get the below output

&lt;?pb label='138'?&gt;<div class="tr_footnote">
<div class="footnote">
<sup>
<a name="ftn.855" href="#f855" class="tr_ftn">855</a>
</sup>a</div>
</div>&lt;?pb label='138'?&gt;<div class="tr_footnote">
<div class="footnote">
<sup>
<a name="ftn.857" href="#f857" class="tr_ftn">857</a>
</sup>b</div>
</div>&lt;?pb label='138'?&gt;<div class="tr_footnote">
<div class="footnote">
<sup>
<a name="ftn.860" href="#f860" class="tr_ftn">860</a>
</sup>c</div>
</div>&lt;?pb label='138'?&gt;<div class="tr_footnote">
<div class="footnote">
<sup>
<a name="ftn.861" href="#f861" class="tr_ftn">861</a>
</sup>At [8-209].</div>
</div>&lt;?pb label='138'?&gt;<div class="tr_footnote">
<div class="footnote">
<sup>
<a name="ftn.862" href="#f862" class="tr_ftn">862</a>
</sup>[1896] 2 Ch 743.
</div>
</div>
but i want the output as below.

&lt;?pb label='138'?&gt;<div class="tr_footnote">
<div class="footnote">
<sup>
<a name="ftn.855" href="#f855" class="tr_ftn">855</a>
</sup>a</div>
</div><div class="tr_footnote">
<div class="footnote">
<sup>
<a name="ftn.857" href="#f857" class="tr_ftn">857</a>
</sup>b</div>
</div><div class="tr_footnote">
<div class="footnote">
<sup>
<a name="ftn.860" href="#f860" class="tr_ftn">860</a>
</sup>c</div>
</div><div class="tr_footnote">
<div class="footnote">
<sup>
<a name="ftn.861" href="#f861" class="tr_ftn">861</a>
</sup>At [8-209].</div>
</div><div class="tr_footnote">
<div class="footnote">
<sup>
<a name="ftn.862" href="#f862" class="tr_ftn">862</a>
</sup>[1896] 2 Ch 743.
</div>
</div>
i.e. the first footnote following the page number should have pb label tag, the footnote location can be ignored. i.e. the footnote can be anywhere in the XML but the first footnote following para should get pb label tag and rest should be ignored.

please let me know how can i do it.

Thanks

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.