]> git.sesse.net Git - xml-template/commitdiff
Fix the include example for PHP as well.
authorsgunderson@bigfoot.com <>
Sat, 12 Aug 2006 19:36:47 +0000 (21:36 +0200)
committersgunderson@bigfoot.com <>
Sat, 12 Aug 2006 19:36:47 +0000 (21:36 +0200)
php/include.php
php/xml-template.php

index 8cbe0010f7173ffce5a6e09d1f4227412ac5d43e..8819ef72e1e6cdb0d6647c1799ef62942976e161 100644 (file)
@@ -3,7 +3,7 @@ require('xml-template.php');
 
 $doc = XML_Template_process_file('../xml/included.xml', array(
        'color' => 'red'
-));
+), 0);
 $master = XML_Template_process_file('../xml/master.xml', array(
        'title' => 'Main HTML title',
        'h1' => 'Nice heading here',
index 00f6e69983d681667bb574410f75b58702302029..dc28a2d0040bcbc2132e123f375c50f4fe9102b2 100644 (file)
@@ -20,6 +20,10 @@ function XML_Template_process($node, $obj, $clean = 1)
 
                $newobj = $obj->clone_node(true);
                $node->append_child($newobj);
+
+               if ($clean) {
+                       clean($newobj);
+               }
        } else if (!is_array($obj)) {                         # overwrite
                foreach ($node->child_nodes() as $child) {
                        $node->remove_child($child);