Archive for April, 2011

Sort any XML file in PHP with this XSL

No Gravatar

XMLI was working on a project a while back that required a web interface to edit, delete, and insert event entries into an XML file. My biggest problem was that anytime I would edit or insert an event element, it would appear in the XML file as the last node rather than in date order. I figured out how to sort the XML contents as they were rendered in HTML using an XSLT (EXtensible Stylesheet Language Transformation). This worked fine for that particular display but this XML needed to be displayed several different ways in different places and I wasn’t thrilled with the thought of having to create an XSL file for every variation. All I really needed was one XSL file to sort the XML data each time it was updated.

Read the rest of this entry »