Mercurial > defr > templates
comparison class.template.php @ 10:04b1d6bca316
Non-utilisée, il s'agit d'une ancienne version de parseSelector
| author | Franck Deroche <webmaster@defr.org> |
|---|---|
| date | Sun, 21 Oct 2007 16:28:30 +0200 |
| parents | d06e9d5ff344 |
| children | a7ce1a423cbe |
comparison
equal
deleted
inserted
replaced
| 9:d06e9d5ff344 | 10:04b1d6bca316 |
|---|---|
| 89 $obj['nodes'] = $root->getElementsByTagName($selector); | 89 $obj['nodes'] = $root->getElementsByTagName($selector); |
| 90 } | 90 } |
| 91 return (object)$obj; | 91 return (object)$obj; |
| 92 } | 92 } |
| 93 | 93 |
| 94 function getNodesMatching($selector, DOMElement $root) { | |
| 95 $pos = strpos($selector, '/'); | |
| 96 if($pos !== false) { | |
| 97 $currentSelector = substr($selector, 0, $pos); | |
| 98 $remainingSelector = substr($selector, $pos+1); | |
| 99 } | |
| 100 else { | |
| 101 $currentSelector = $selector; | |
| 102 $remainingSelector = NULL; | |
| 103 } | |
| 104 if($selector[0] == '#') { | |
| 105 $nodes = $this->xmlXPath->query($currentSelector, $root); | |
| 106 } | |
| 107 else { | |
| 108 | |
| 109 } | |
| 110 } | |
| 111 | |
| 112 function parseReplacement($obj) { | 94 function parseReplacement($obj) { |
| 113 $retVal = NULL; | 95 $retVal = NULL; |
| 114 if(is_string($obj)) | 96 if(is_string($obj)) |
| 115 $retVal = $this->xmlDocument->createTextNode($obj); | 97 $retVal = $this->xmlDocument->createTextNode($obj); |
| 116 else if($obj instanceof DOMDocument) | 98 else if($obj instanceof DOMDocument) |
