# HG changeset patch # User Franck Deroche # Date 1192969089 -7200 # Node ID 0b796d56c767ea31228efc80ba41beea3bca086f # Parent 61dee7e34a9dfbd023428d74db6379ad6d7e466d Suppression du pre-supposé selon lequel l'espace de template est prefixé t. diff -r 61dee7e34a9d -r 0b796d56c767 class.template.php --- a/class.template.php Sun Oct 21 14:14:23 2007 +0200 +++ b/class.template.php Sun Oct 21 14:18:09 2007 +0200 @@ -10,6 +10,7 @@ $this->xmlDocument->validateOnParse = $shouldValidate; $this->xmlDocument->loadXML(file_get_contents($fileName)); $this->xmlXPath = new DOMXPath($this->xmlDocument); + $this->xmlXPath->registerNamespace('_t', Template::NS); } function apply($selector, $obj, DOMElement $root = null) { @@ -79,7 +80,7 @@ $selector = substr($selector, 0, $pos); } if($selector[0] == '#') { - $obj['xpath'] = "//*[@t:id='" . substr($selector, 1) . "']"; + $obj['xpath'] = "//*[@_t:id='" . substr($selector, 1) . "']"; $obj['nodes'] = $this->xmlXPath->query($obj['xpath'], $root); } else { @@ -140,7 +141,7 @@ function clean() { // Suppression des noeuds à cloner - $nodes = $this->xmlXPath->query("//*[@t:toClone]|//t:*"); + $nodes = $this->xmlXPath->query("//*[@_t:toClone]|//_t:*"); foreach($nodes as $node) { if($node->parentNode) { $node->parentNode->removeChild($node);