xsl-list
[Top] [All Lists]

Re: Removing pseudo-markup via xslt?

2005-12-05 04:14:10
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.

Hi Brooks,

You can do one of several things:
a) Make a recursive solution, using substring-before(....,'[') and
substring-after(.....,']') to get the desired text.
b) Make an extension function, that makes a replace.
c) Look to other sources for extension: EXSLT, FXSL or others.

Regards,
Ragulf Pickaxe :-)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>