Twita@talinkahashifyer in XSLT?
This is an open discussion with 5 replies, filed under XSLT.
Search
Great idea!
On first glance I would use the EXSLT tokenize()
function to split the string up into individual words that can be iterated over and processed. Unfortunately XSLT 1.0 and the EXSLT library under LibXSLT does not support regular expressions, which would have made a direct port very simple.
I might have a stab at this on my commute home :-)
Would be great!
Try this for size. I’ve only tested it with the example on Dustin’s demo page and it seems to work well. If you can confirm, I’ll put it up as an XSLT Utility.
I just wish we could use regular expressions! It’d save an awful lot of string manipulation and recursion.
[code removed]
Thank you Nick, it works perfectly!
Great :-) I’ve added it as a Utility:
Create an account or sign in to comment.
http://www.dustindiaz.com/basement/ify.html
Just saw this piece of JS from Dustin Diaz and realized it’s exactly what’s missing from my Symphony-powered Twitter cache. Basically, it takes a plain-text status string, and adds HTML links for any at-replies (@ded), hash tags (#symphony-cms), and plain-old links (http://…).
Would anyone be interested in porting this to XSLT, or pointing me to resources that would help me do it myself? Or, would it be better to do this in PHP when I’m importing my Twitter feed, and store them as HTML fragments?
Thanks,
Brian