Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 30th, 2009, 10:50 AM
Authorized User
 
Join Date: May 2008
Posts: 31
Thanks: 6
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rangeshram
Default Display attribute and particular string in different color

Hi All,

We need to change the attribute color of the particular element and particular string (original content) in this case should be differentiated in xslt.

e.g.,
<footnote num="16" int="Replace this footnote with the following">This is the 16th footnote with the original content and speaks about Banking Act 1973 (Act 102) (repealed)</footnote>
<footnote num="17" int="Replace this footnote with the following">This is the 16th footnote and speaks about Banking Act 1973 (Act 102) (repealed)</footnote>

o/p:
<p>Replace this footnote with the following his is the 16th footnote with the original content and speaks about Banking Act 1973 (Act 102) (repealed)</p>

<p>Replace this footnote with the following This is the 16th footnote and speaks about Banking Act 1973 (Act 102) (repealed)</p>

my xslt code:

<xsl:template match="footnote">
<p><font color='darkred'><b><xsl:value-of select="@int"/></b></font></p>
<xsl:apply-templates/>
</xsl:template>

But my problem is just convert first instance of footnote rest of the footnotes were skipped. please help..

Thanks
 
Old October 30th, 2009, 06:49 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

It looks as if the template is only being applied to the first footnote. To find the error in your code you need to look for the apply-templates instruction that selects footnotes and causes templates to be applied to them. There's nothing wrong with the footnote template itself - it just isn't being called.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
The Following User Says Thank You to mhkay For This Useful Post:
rangeshram (October 31st, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
extract string from value of attribute camacho XSLT 1 August 16th, 2007 02:44 AM
how to display color palette swati_joshi ASP.NET 1.0 and 1.1 Basics 0 March 28th, 2006 04:32 AM
Invalid Connection String Attribute rstelma Classic ASP Databases 8 July 6th, 2005 06:31 PM
color attribute with <li> econophil HTML Code Clinic 2 August 31st, 2004 02:22 PM
display different color in loop mateenmohd Classic ASP Basics 2 June 16th, 2004 06:40 AM





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