473,395 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Highlight Text

Mac
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
Jul 20 '05 #1
1 2470
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.)

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: David Morgan | last post by:
Hello I have a little function to highlight text if it exists. Function Highlight(vFind, vSearch) Dim RegEx Set RegEx = New RegExp RegEx.Pattern = vFind RegEx.IgnoreCase = True Highlight =...
5
by: Atara | last post by:
I am trying to convert the following code to VB .Net, I still have some gaps (the lines that are marked with (*)) and also I need an ending condition for the while loop. any help would be...
2
by: Number 11950 - GPEMC! Replace number with 11950 | last post by:
When you highlight a selection of text represented in an object on a form, somewhere in the Framework or alternatively in the Windows API there exists an array of variables that either contain as a...
2
by: Celeste | last post by:
Hello, I'm trying to parse the referring url for google search terms so that when this page loads it will scroll to and highlight the search term(s). Should i be using document.referrer? ...
0
Merlin1857
by: Merlin1857 | last post by:
A thing I have been asked for on a number of occasions is the ability to highlight text after its been searched for in a record return page. The following does this perfectly. Use this function...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.