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

Move Text

Subject: Move Text
From: "Byomokesh Sahoo sahoo.byomokesh@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 9 Apr 2024 04:22:54 -0000
 Move Text
Hi,

I am trying to move text to paragraph based on SUP value matching. Please
find the below xml, output xml and xsl.

XML
--------
<body>
    <div id="FNid000">
    <p margin-left="123.25pt">8.3. In
        <a name="_ftnref1"/>
        <a href="#_ftn1"><sup>[1]</sup></a>, this analysed different<a
href="#_ftn2"><sup>[2]</sup></a> mean</p>
    </div>
    <div id="FNid001">
        <p class="FootnoteText"
            margin-left="94.95pt">
            <sup>[1]</sup> 2001 9 SCC</p>
    </div>
    <div id="FNid002">
        <p class="FootnoteText"
            margin-left="94.95pt">
            <sup>[2]</sup><b>2011 3 SCC 626</b>
        </p>
    </div>

</body>

Expected Output
---------------------------
<body>
    <div id="FNid000">
    <p margin-left="123.25pt">8.3. In
        <p class="FootnoteText"
            margin-left="94.95pt">
            <sup>[1]</sup> 2001 9 SCC</p>, this analysed different<p
class="FootnoteText"
            margin-left="94.95pt">
            <sup>[2]</sup><b>2011 3 SCC 626</b>
        </p> mean</p>
    </div>
</body>

XSL:
--------
<xsl:template match="sup">
            <xsl:variable name="div-id1"
select="..//ancestor::body/div/p[@class='FootnoteText']//text()"/>
            <xsl:choose>
                <xsl:when

test="following::p[not(@class='ListParagraph')][parent::div//sup/current()
= $div-id1]/node()">

                            <xsl:apply-templates

select="following::p[not(@class='ListParagraph')][parent::div/@id =
$div-id1]//node()"/>

                </xsl:when>
                <xsl:otherwise>
                    <xsl:element name="sup">
                        <xsl:apply-templates/>
                    </xsl:element>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>

Please Suggest.

Thanks

Current Thread
  • Move Text
    • Byomokesh Sahoo sahoo.byomokesh@xxxxxxxxx - 9 Apr 2024 04:22:54 -0000 <=

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

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