Is it possible to apply multiple utilities to a single chunk of text?
This is an open discussion with 2 replies, filed under XSLT.
Search
Why don't you apply a text-formatter to the users comment so you don't have to care in the XSL template?
I've thought of that in this particular context, but then I realised that it is a good xslt challenge with more than a single use case (thus very healthy to know for the sake of the future projects).
Especially, when using Ninja utility, which exhausts all capabilities to do something else "utility-wise" with your content.
So the question was meant more targeted to the root level of xslt capabilities; less connected to this concrete comments case.
Sorry for my messy writings - I don't normally speak english, so it's sometimes quite hard to express some subtle nuances.
Create an account or sign in to comment.
I'm not yet that flexible with XSLT to find out it by myself :)
Example use case:
User comments on a blog post, inserts newlines (hits enter in a textarea) and optionally adds his/her plain text URL(s).
In output I'd like to preserve those newlines (replace them with BR tags) and parse urls to build appropriate A tags.
There are utilities to do both of those - nl2br for newlines and I adopted twitter format utility to work with urls in comments (no probs here).
So the Q: Is it possible to invoke nl2br before url parser and output the single combined result?
Thanks in advance, k.