Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Replace hithighlight tags

From: "Peter van Schie" <vanschie.peter@-----.--->
To: 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.



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent