[Top] [All Lists]

RE: Re: Spam:[xsl] Stripping out non-*ML tags?

2005-11-14 17:17:41
Strictly for readability, I need to strip or at least minimize
the amount of that stuff that gets past my XSL.  I would be
perfectly happy to replace, in regex terms, \[[^\]]\] with "".
That is, just delete all of the tags, so that "[b]text[/b]"
becomes "text"

If you can use XSLT 2.0, you can actually use regular 
expressions. That's 
one of 2.0's very welcome features. If you can switch to 2.0 or are 
already using it, look at xsl:analyze-string.

Another way of tackling this input would be to replace the [] characters by
<> (using the translate function), and then use saxon:parse() or a similar
extension function to parse the resulting character string as XML.

Michael Kay

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>