Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 7th, 2014, 03:18 PM
Authorized User
Points: 151, Level: 3
Points: 151, Level: 3 Points: 151, Level: 3 Points: 151, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2013
Posts: 31
Thanks: 3
Thanked 0 Times in 0 Posts
Default match different instances

I've the below case in my XML.

Code:
<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.

Code:
  <xsl:template match="footnote">    
    <xsl:if test="preceding::page[1]">
           <xsl:variable name="op"><</xsl:variable>
        <xsl:variable name="apos">'</xsl:variable>
        <xsl:variable name="cl">></xsl:variable>
        
        <xsl:value-of select="concat($op,'?pb label=',$apos,preceding::page[1]/@num,$apos,'?',$cl)"/>
        
           </xsl:if>
    </xsl:template>
and i get the below output

Code:
    &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.

Code:
    &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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Several instances of the same Mobile Service maca BOOK: Windows Azure Web Sites 0 December 23rd, 2013 04:52 PM
How many Instances are running dash dev C# 2005 7 December 5th, 2007 04:05 PM
template match doesnt match the required node Tomi XSLT 2 March 12th, 2007 06:24 AM
Question on DataSet instances VictorQ BOOK: Beginning C# 2005 Databases 0 January 28th, 2007 11:11 PM
One form in multiple instances. Sink Access VBA 0 June 7th, 2004 04:25 AM



All times are GMT -4. The time now is 01:17 PM.


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