Software engineering notes

playing with e4x in firefox: loading arbitrary xml as an e4x-ready object

prereq: firefox w/ firebug installed and a server running php w/ simplexml
1) put this code in an php file
2) upload this file to your server
3) run it in firefox
4) look for output in console
var xml = new XML(
	$url = '';
	$sxml = simplexml_load_file($url);
    //strip off the xml declaration because the javascript XML() object expects raw xml
	echo str_replace('<?xml version="1.0" encoding="UTF-8"?>', '', $sxml->asXML());

Written by Erik

May 22, 2009 at 11:00 am

Posted in code, tutorial

Tagged with , ,

%d bloggers like this: