[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] UBB Code and XSLT

Subject: Re: [xsl] UBB Code and XSLT
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Sun, 11 Jan 2004 22:46:26 +0100

Karl J. Stubsjoen wrote:

What does this mean:
Again, that's not too difficult with an S&R template.

You can try plain string substitution [b] -> <b> [/b] -> </b> [u] -> <u> and so on, using for example code from the XSL FAQ (as usual): http://www.dpawson.co.uk/xsl/sect2/replace.html#d6768e37 You'll have to hack the code in order to disable output escaping, otherwise you'd get &lt;b&gt; instead of <b> and so on. This pretty much requires the transformation result serialized immediately, but you certainly know this. You can try to fold substitution of the UBB codes into one template using a lookup, rather than running the template for every UBB code you want to handle.

Codes like [img=http://foo/bar] need some more attention but can
be handled with a simple extension of the FAQ answer code.

If you can't use d-o-e, things become complicated. Furthermore, if
the UBB source is, well, malformed, the resulting HTML will be
malformed too. And don't think your users will pay attention, visit
an arbitrary forum and you'll find bad stuff in the first not-too-short
thread you'll visit.


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

Current Thread