I need some help to understand the DOMElement::nodeValue behavior regarding entities. Here is a little XML file :
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<input><</input>Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="input">
<output>
<xsl:value-of select="." />
</output>
</xsl:template>
</xsl:stylesheet>Code: Select all
<html>
<body>
<?php
$xmlDocument = new DOMDocument ();
$xmlDocument->load ("test.xml");
$xmlStylesheet = new DOMDocument ();
$xmlStylesheet->load ("test.xsl");
$xslTransfom = new XSLTProcessor ();
$xslTransfom->importStylesheet ($xmlStylesheet);
$xmlDocument = $xslTransfom->transformToDoc ($xmlDocument);
echo ($xmlDocument->documentElement->firstChild->nodeValue);
?>
</body>
</html>Code: Select all
echo ($xmlDocument->saveXML ());May somebody help me to understand this behavior ? Thanx.<output><</output>