|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2003-05-07 15:29 UTC] chregu@php.net
  [2003-05-07 15:42 UTC] bharris at spro dot net
  [2003-05-07 16:30 UTC] rrichards@php.net
  [2003-05-07 16:49 UTC] bharris at spro dot net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 18:00:01 2025 UTC | 
--SCRIPT-- $xmlstr = '<?xml version="1.0"?><configuration><datasources><subtree name="Test"><apply-template name="test.xml.com"/></subtree></datasources></configuration>'; $dom = domxml_open_mem($xmlstr); $root = $dom->document_element(); $element = 0; transversenodes($root, 'first'); $dom->free(); $dom = domxml_open_mem($xmlstr); $root = $dom->document_element(); $element = 0; transversenodes($root, 'second'); nice_r($_SESSION); function transversenodes (&$node, $string) { global $element; if ($node->has_child_nodes()) { $child = $node->child_nodes(); for ($i = 0; $i < count($child); $i++) { if ($child[$i]->node_type() == XML_ELEMENT_NODE) { if ($child[$i]->tagname == 'apply-template') { $_SESSION[$string][$element] = $child[$i]; $element++; break; } if ($child[$i]->tagname == 'subtree') { $_SESSION[$string][$element] = $child[$i]; $element++; } transversenodes($child[$i], $string); } } } } function nice_r (&$variable) { echo "<pre>\n"; print_r($variable); echo "</pre>\n"; } --MODULES-- './configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs2=/usr/sbin/apxs' --COMMENTS-- I appologize for the length of the test script but I couldn't trim it any more to show my point My problem is that I can't reset the internal namespace for DOMXML documents unless I load a new page (i.e. can't reset the dom space within a single script). I need to have access to functions that will do whatever is done between page loads because that successfully resets the internal treenode pointer. I need to be able to load a document into an internal treenode, modify it, write it to file then display a graphical hyperlinked representation of the modified treenode on the same "page". Without being able to reset the internal treenode my serialized objects don't point at the correct object on the next page and I get an error. Reclicking the same hyperlink at this point works because ending the script the first time resets the internal treenode correctly. I thought $dom->free() would work but it appears it's not, if you run my script you'll see that the object id's are different for the second dom object even though it's the same document, just reloaded.