[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|