# HG changeset patch # User Franck Deroche # Date 1192969854 -7200 # Node ID d06e9d5ff3444f4d8197483a09c3a8c637c37798 # Parent 0b796d56c767ea31228efc80ba41beea3bca086f Affichage correctement indenté (d'après PHP) du fichier XML de sortie. diff -r 0b796d56c767 -r d06e9d5ff344 class.template.php --- a/class.template.php Sun Oct 21 14:18:09 2007 +0200 +++ b/class.template.php Sun Oct 21 14:30:54 2007 +0200 @@ -8,6 +8,7 @@ function __construct($fileName, $shouldValidate = false) { $this->xmlDocument = new DOMDocument(); $this->xmlDocument->validateOnParse = $shouldValidate; + $this->xmlDocument->preserveWhiteSpace = false; $this->xmlDocument->loadXML(file_get_contents($fileName)); $this->xmlXPath = new DOMXPath($this->xmlDocument); $this->xmlXPath->registerNamespace('_t', Template::NS); @@ -151,7 +152,7 @@ function __toString() { $this->clean(); - $this->xmlDocument->saveXML(); + $this->xmlDocument->formatOutput = true; return $this->xmlDocument->saveXML(); } }