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

Removing pseudo-markup via xslt?

Subject: Removing pseudo-markup via xslt?
From: "Talley, Brooks" <brooks@xxxxxxxx>
Date: Sun, 4 Dec 2005 11:42:04 -0800
xslt strip
First, I apologize if this is a FAQ. I've googled and looked at the list
archives, and while I can find plenty of "string replace" questions and
answers, I haven't found a "faux regex" answer.

I have an application that uses vBulletin-style markup; essentially a
pared down version of html using square brackeres.  [b]test[/b] is bold,
etc.

I'm getting those messages in XML format, and I need xslt to just strip
out all of the pseudo-markup tags.  Anything between square brackets
(and including the square brackets) should just be removed.

Sample input:
<?xml version="1.0"?>
<root>
<text>[b]Bold[/b] [red][i]red italics[/i][/red]</text>
</root>

Desired output:
Bold red italics

Unforunately, I'm stuck with msxml 6.0, which I believe does not support
the replace() function.  That would be too easy.

Is there any reasonable way to accomplish this?  The other alternative
is instantiating a regex engine in the database that's providing the
results, but that's a pretty ugly solution.  I'd really rather do it in
the xslt, and then just update that if/when ms starts supporting
replace().

Thanks
-Brooks

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.