[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: string replacement for HTML tags

Subject: Re: string replacement for HTML tags
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Thu, 25 Apr 2002 22:34:57 +0200
html tag recursive replace
Hello Daniel,

I think this is a legitimate use case for disable-output-escaping.

<xsl:template match="data">
  <xsl:value-of disable-output-escaping="yes"
      select="translate(., '[]', '&lt;&gt;')"/>
</xsl:template>

So with translate() you don't need a recursive approach.

Regards,

Joerg

Daniel Fisher wrote:
Hello,
I'm trying to do some string replacement in my transform to generate HTML.
Basically I've got a node like this:

<data>This text is [b]bold[/b]</data>

When I've finished my transform I want:

This text is <b>bold</b>

This seems pretty easy using recursion, however it becomes a mess if you introduce
multiple string replacements to support tags like [u] and [i].

Is it possible to store the results from a template without displaying them
and then perform several string replacements on the results?

Once I've made all the replacements I need I could then display the final results.


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.