Highlight Text

Mac

Usenet Archive
Joined
Mar 1, 2001
Messages
248
Reaction score
0
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
 

Johannes Koch

Usenet Archive
Joined
Nov 14, 2000
Messages
801
Reaction score
0
Mac said:
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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,802
Members
249,594
Latest member
henrywalsh

Latest Threads

Top