I often annoys me when people don’t make it clear what they’re referencing in an article. Sometimes people don’t give any references at all, and when they do they use links on words that shouldn’t be links (the click here syndrome).
So I wrote this JavaScript to help out. It adds a section at the bottom of each of your Wordpress posts containing all the links you referred to in a post:
Read More →
We have a PHP CMS with a lot of poorly written HTML in the client–contributed content. This kept causing my XSL template system to output XML errors. I got around this problem by:
- wrapping content in CDATA tags
- Checking if the content is valid XML with
xml_parse() in PHP, if not I add a CDATA tag and try again.
- Strip out bad characters that may have crept in from Word
- Process the XSL and XML using
xsl:value-of tags with disable-output-escaping="yes"
Using CDATA tags around unpredictable HTML helps prevent problems with the XML parser. Without the final step, the resulting HTML contains the original HTML with HTML entities.
Read More →
Textile provides a simple way of writing human–friendly text that can easily be translated to XHTML. HTML tags are simplified into a set of phrase and block modifiers; even tables and attributes can be created.
I was looking at the PHP code for this and wondering if I could create an XSL file that could translate similar text into XHTML. I created some XML to contain my text:
Read More →
I’ve found two approaches to this:
I think the second method looks like the best. I like the idea of using a general XSLT template to add in generic functionality too.
Read More →
I often use a message class for a lot of things with PHP. This allows me to build messages to display to the user for errors, successes and general feedback.
Classes for each of these three things are created in CSS to display the information, and then I use a simple PHP class for appending messages to a arrays.
Read More →