Search

I have an interesting one:

Given XML output of a classic text field:

<p>Lorem ipsum dolor sit amet.</p>
<h2>Lorem ipsum</h2>
<p>Curabitur sodales ligula in libero.</p>

I'd like to highlight various portions of text. For example, I'd like to wrap each a letter in a span. The problem is I get each resulted <span>a</span> in plain text:

Lorem ipsum dolor sit <span>a</span>met.
Lorem ipsum
Cur<span>a</span>bitur sod<span>a</span>les ligul<span>a</span> in libero.

Any ideas how to add this extra span tag?

Edit:

Got it! Posted on the XSLT tips thread.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details