Click here to Skip to main content
16,005,141 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionSpecific values [modified] Pin
Icarus12312-Jun-07 2:13
Icarus12312-Jun-07 2:13 
AnswerRe: Specific values Pin
Fatbuddha 112-Jun-07 23:10
Fatbuddha 112-Jun-07 23:10 
AnswerRe: Specific values Pin
S Douglas16-Jun-07 22:24
professionalS Douglas16-Jun-07 22:24 
Questiongenerate xslt code dynamically Pin
sdee211-Jun-07 14:42
sdee211-Jun-07 14:42 
AnswerRe: generate xslt code dynamically Pin
led mike12-Jun-07 4:45
led mike12-Jun-07 4:45 
Questionlanguage codings Pin
HUMPPAAA!11-Jun-07 3:30
HUMPPAAA!11-Jun-07 3:30 
AnswerRe: language codings Pin
HUMPPAAA!11-Jun-07 4:16
HUMPPAAA!11-Jun-07 4:16 
Questionxsl highlight function breaking html tags Pin
werD8-Jun-07 8:33
werD8-Jun-07 8:33 
hello,
Ive come across a highlight function that i was able to add to a search feature i have on a page. however the current method it uses will wrap text that is found even inside of html so its making the tags no longer work. has anyone dealt with this type of thing before?

here's the highlighter template
example of problem
$text = <a href="http://www.walkthroughs.com">Simple steps to walkthrough</a>
$what = walk
output=<a href="http://www.<font style...>walk</font>throughs.com">Simple steps to <font style...>walk</font>through</a>
<code> <xsl:template name="highlighter">
<xsl:param name="text"/>
<xsl:param name="what"/>
<xsl:variable name="test-text">
<xsl:call-template name="lower">
<xsl:with-param name="tolower" select="$text" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="test-what">
<xsl:call-template name="lower">
<xsl:with-param name="tolower" select="$what" />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($test-text, $test-what)">
<xsl:variable name="before" select="substring-before($test-text,$test-what)"/>
<xsl:variable name="after" select="substring-after($test-text,$test-what)"/>
<xsl:variable name="real-before" select="substring($text, 1,string-length($before))"/>
<xsl:variable name="real-after" select="substring($text,string-length($before) + string-length($what) + 1)"/>
<xsl:value-of select="$real-before" disable-output-escaping="yes"/>
<font style="background-color:#66FF66"><xsl:value-of select="$what" disable-output-escaping="yes"/></font>
<xsl:call-template name="highlighter">
<xsl:with-param name="text" select="$real-after"/>
<xsl:with-param name="what" select="$what"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template></code>

Id appreciate any insight on this. i thought that perhaps i could examine for an unclosed < in before variable and unopened > in after but im not sure what the best way to do this would be

Thanks in advance

werD, MCP
AnswerRe: xsl highlight function breaking html tags Pin
werD8-Jun-07 10:43
werD8-Jun-07 10:43 
Questionxs:group with attribute Pin
Eugene Mirotin (Guard)7-Jun-07 11:41
Eugene Mirotin (Guard)7-Jun-07 11:41 
QuestionLogicaly selecting a section of XML Pin
Haun the 2nd7-Jun-07 11:11
Haun the 2nd7-Jun-07 11:11 
AnswerRe: Logicaly selecting a section of XML Pin
Haun the 2nd20-Jun-07 8:02
Haun the 2nd20-Jun-07 8:02 
QuestionXML Web service Pin
dews turner6-Jun-07 5:14
dews turner6-Jun-07 5:14 
AnswerRe: XML Web service Pin
Eugene Mirotin (Guard)8-Jun-07 4:41
Eugene Mirotin (Guard)8-Jun-07 4:41 
QuestionRe: XML Web service Pin
dews turner10-Jun-07 21:55
dews turner10-Jun-07 21:55 
Questionregarding xsl Pin
DGtech4-Jun-07 23:14
DGtech4-Jun-07 23:14 
AnswerRe: regarding xsl Pin
blackjack21505-Jun-07 0:56
blackjack21505-Jun-07 0:56 
QuestionHow to validate dynamic controls Pin
praveenkumar_mca4-Jun-07 21:19
praveenkumar_mca4-Jun-07 21:19 
AnswerRe: How to validate dynamic controls Pin
George L. Jackson5-Jun-07 11:40
George L. Jackson5-Jun-07 11:40 
QuestionXMLClassGenerator.exe Pin
Carmelo T.4-Jun-07 19:27
Carmelo T.4-Jun-07 19:27 
AnswerRe: XMLClassGenerator.exe Pin
George L. Jackson5-Jun-07 11:42
George L. Jackson5-Jun-07 11:42 
GeneralRe: XMLClassGenerator.exe Pin
Carmelo T.6-Jun-07 3:35
Carmelo T.6-Jun-07 3:35 
Questionhow do you set the data of an XML node? Pin
nathan74-Jun-07 17:51
nathan74-Jun-07 17:51 
QuestionCell Border not displaying for null or empty vlaues Pin
engsrini4-Jun-07 11:17
engsrini4-Jun-07 11:17 
AnswerRe: Cell Border not displaying for null or empty vlaues Pin
Arun.Immanuel4-Jun-07 15:33
Arun.Immanuel4-Jun-07 15:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.