So I've wanted to create a very basic XML file parser that imports XML styles.
<?php
//error_reporting(0);
$XSLT = new XSLTProcessor();
$XML = new DOMDocument();
$XSL = new DOMDocument();
$XSL->load($_GET['file']);
$XSLT->importStyleSheet($XSL);
print $XSLT->transformToXML($XML);
Now I need to read an arbitrary file like this:
http://localhost/parser.php?file=style.xml
Given that I find it hard to troubleshoot as to why I cannot seem to read a .txt file on the local filesystem in the same directory.
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match='/'>
<xsl:copy-of select="document('message.txt')"/>
</xsl:template>
</xsl:stylesheet>