<?php header('Content-type: application/xml; charset=UTF-8;'); ?>
<?php 
	// Load the raw XML data and standard stylesheet as domdocuments.
	$xsl = new DomDocument('1.0', 'UTF-8');
	$xsl->load("data/xml2bxml_standard.xsl");
	$inputdom = new DomDocument();
	$inputdom->load("data/filmdata.xml");
	
	// Create the processor and import the stylesheet.
	$proc = new XsltProcessor();
	$xsl = $proc->importStylesheet($xsl);
	
	// Transform the xml document and output its root node without the 
	// xml declaration because that should not end up in the middle of a web page.
	$newdom = $proc->transformToDoc($inputdom);
	print $newdom->saveXML($newdom->firstChild);
?>