classes/phing/system/io/XmlFileParser.php
private function addNode($node, $path, $prop)
    {
        foreach ($node as $tag => $value) {
            $prefix = implode('.', $path);

            if ($prefix !== '') {
                $prefix .= '.';
            }

            // Check for attributes
            foreach ($value->attributes() as $attribute => $val) {
                if ($this->collapseAttr) {
                    $prop->setProperty($prefix . "$tag.$attribute", (string) $val);
                } else {
                    $prop->setProperty($prefix . "$tag($attribute)", (string) $val);
                }
            }

            // Add tag
            if (count($value->children())) {
                $this->addNode($value, array_merge($path, [$tag]), $prop);
            } else {
                $val = (string) $value;

                /* Check for * and ** on 'exclude' and 'include' tag / ant seems to do this? could use FileSet here
                if ($tag == 'exclude') {
                }*/

                // When property already exists, i.e. multiple xml tag
                // <project>
                //    <exclude>file/a.php</exclude>
                //    <exclude>file/a.php</exclude>
                // </project>
                //
                // Would be come project.exclude = file/a.php,file/a.php
                $p = empty($prefix) ? $tag : $prefix . $tag;
                $prop->append($p, (string) $val, $this->delimiter);
            }
        }
    }
private function addNode($node, $path, $prop)
    {
        foreach ($node as $tag => $value) {
            $prefix = implode('.', $path);

            if ($prefix !== '') {
                $prefix .= '.';
            }

            // Check for attributes
            foreach ($value->attributes() as $attribute => $val) {
                if ($this->collapseAttr) {
                    $prop->setProperty($prefix . "$tag.$attribute", (string) $val);
                } else {
                    $prop->setProperty($prefix . "$tag($attribute)", (string) $val);
                }
            }

            // Add tag
            if (count($value->children())) {
                $this->addNode($value, array_merge($path, [$tag]), $prop);
            } else {
                $val = (string) $value;

                /* Check for * and ** on 'exclude' and 'include' tag / ant seems to do this? could use FileSet here
                if ($tag == 'exclude') {
                }*/

                // When property already exists, i.e. multiple xml tag
                // <project>
                //    <exclude>file/a.php</exclude>
                //    <exclude>file/a.php</exclude>
                // </project>
                //
                // Would be come project.exclude = file/a.php,file/a.php
                $p = empty($prefix) ? $tag : $prefix . $tag;
                $prop->append($p, (string) $val, $this->delimiter);
            }
        }
    }
private function addNode ( $ node , $ path , $ prop ) { foreach ( $ node as $ tag => $ value ) { $ prefix = implode ( '.' , $ path ) ; if ( $ prefix !== '' ) { $ prefix .= '.' ; } // Check for attributes foreach ( $ value -> attributes ( ) as $ attribute => $ val ) { if ( $ this -> collapseAttr ) { $ prop -> setProperty ( $ prefix . "$tag.$attribute" , ( string ) $ val ) ; } else { $ prop -> setProperty ( $ prefix . "$tag($attribute)" , ( string ) $ val ) ; } } // Add tag if ( count ( $ value -> children ( ) ) ) { $ this -> addNode ( $ value , array_merge ( $ path , [ $ tag ] ) , $ prop ) ; } else { $ val = ( string ) $ value ; /* Check for * and ** on 'exclude' and 'include' tag / ant seems to do this? could use FileSet here
                if ($tag == 'exclude') {
                }*/ // When property already exists, i.e. multiple xml tag // <project> //    <exclude>file/a.php</exclude> //    <exclude>file/a.php</exclude> // </project> // // Would be come project.exclude = file/a.php,file/a.php $ p = empty ( $ prefix ) ? $ tag : $ prefix . $ tag ; $ prop -> append ( $ p , ( string ) $ val , $ this -> delimiter ) ; } } }
Adds an XML node

@param SimpleXMLElement $node
@param array $path Path to this node
@param Properties $prop Properties will be added as they are found (by reference here)

@return void
Adds an XML node