Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Replace hithighlight tags >Thread Next - Re: Replace hithighlight tags Re: Replace hithighlight tagsTo: NULL Date: 10/7/2005 3:26:00 PM Hi Rob and Andy, Thank you both for the reply. I tried Andy's template, but it won't do what I want still. The relevant part of my xslt looks like this: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" cdata-section-elements="fulltext" /> <xsl:template match="/"> [... html header stuff ...] <xsl:if test="/result/document/fulltext!=''"> <tr> <td class="label">Text</td> <td class="label">:</td> <td class="fulldoccontent"> <xsl:apply-templates select="/result/document/fulltext" mode="search-results-with-highlight" /> </td> </tr> </xsl:if> [... html footer stuff ...] </xsl:template> <xsl:template match="searchhit" mode="search-results-with-highlight" > <span style="background: red; padding: 0.125em 0.5em;"> <xsl:apply-templates mode="search-results-with-highlight" /></span> </xsl:template> <xsl:template match="*" mode="search-results-with-highlight" > <!-- This is needed in case of more element structure within <fulltext>, so as to preserve the mode It might even copy some elements (embedded HTML?) to the output --> <xsl:apply-templates mode="search-results-with-highlight" /> </xsl:template> </xsl:stylesheet> I think the problem is that I insert the <searchhit> and </searchhit> tags from PHP. So those tags are treated as CDATA within the fulltext element. Could this be the case? Thanks. Kind regards, Peter. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
