Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Highlight Text

Reply
Thread Tools

Highlight Text

 
 
Mac
Guest
Posts: n/a
 
      09-25-2003
Basically I have some nodes that represent paragraphs

<para>Sally Sells Sea Shells Down By The Sea Shore.</para>

in there, some of the text are wrapped with identifier
<para>Sally <hlt>Sells</hlt> Sea Shells <hlt>Down</hlt> By The Sea
Shore.</para>

I need to change the output of those to be an html element so I can
apply a css style to it.

I have a template to output the text of the para node
I am then calling a template for the hlt node.
But it processes ALL of the hlt nodes and not each one as it comes
across it.
My output comes out like:

<p>Sally <span>Sells</span><span>Down</span> Sea Shells By The Sea
Shore.</p>

Is there any way to accomplish this so it looks like:
<p>Sally <span>Sells</span> Sea Shells <span>Down</span> By The Sea
Shore.</p>

Thanks

Brian
 
Reply With Quote
 
 
 
 
Johannes Koch
Guest
Posts: n/a
 
      09-26-2003
Mac wrote:
> Basically I have some nodes that represent paragraphs
>
> <para>Sally Sells Sea Shells Down By The Sea Shore.</para>
>
> in there, some of the text are wrapped with identifier
> <para>Sally <hlt>Sells</hlt> Sea Shells <hlt>Down</hlt> By The Sea
> Shore.</para>
>
> I need to change the output of those to be an html element so I can
> apply a css style to it.


<xsl:template match="para">
<p>
<!-- This applies templates for all the text and element child nodes -->
<xsl:apply-templates/>
</p>
</xsl:template>

<xsl:template match="hlt">
<span>
<xsl:apply-templates/>
</span>
</xsl:template>

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make a text bar that users can scroll through and be able to highlight the text?!?!! loshbolton@hotmail.com HTML 1 03-10-2006 10:40 PM
How to highlight (change background color) of selected text within a text area omidalavi@yahoo.com Javascript 0 09-23-2005 04:34 PM
How to highlight some text in an iframe by script? =?Utf-8?B?Tmlja3k=?= ASP .Net 3 11-23-2004 05:37 PM
Can not highlight text in a textbox on a ASP.net Page Robert M ASP .Net 1 01-05-2004 10:04 PM
Highlight Text based on certain criteria Stephajn Craig ASP .Net 2 07-07-2003 11:07 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57