Subject: Re: [xsl] Stripping out non-*ML tags? From: JBryant@xxxxxxxxx Date: Mon, 14 Nov 2005 17:48:08 -0600 |
(Reposted to remove the accursed SPAM tag - my apologies to Tommie and the list.) > 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. If you are stuck with XSLT 1.0, regular expressions are out. At that point, I'd make a list of all the markers (both beginning and ending, so [b] and [/b] are separate items in the list) and write a template to replace each term with "". I'd put the list of terms in a separate file and get it with the document function (and maybe a parameter to specify the list document if you need to handle more than one set of markers). I've done something similar (finding each instance of a set of 800+ acronyms and turning them into links in a 2,000-page document), but I had the luxury of using 2.0 and xsl:analyze-string. HTH Jay Bryant Bryant Communication Services (presently consulting at Synergistic Solution Technologies)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Re: Spam:[xsl] Stripping , Michael Kay | Thread | [xsl] Display file name, siarom egrub |
[xsl] Re: Spam:[xsl] Stripping out , JBryant | Date | RE: [xsl] Re: Spam:[xsl] Stripping , Michael Kay |
Month |