Mercurial > defr > templates
changeset 9:d06e9d5ff344
Affichage correctement indenté (d'après PHP) du fichier XML de sortie.
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Sun, 21 Oct 2007 14:30:54 +0200 |
parents | 0b796d56c767 |
children | 04b1d6bca316 |
files | class.template.php |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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(); } }