]> granicus.if.org Git - php/commitdiff
update the profile of how namespaces should work after discussions with
authorSterling Hughes <sterling@php.net>
Fri, 16 Jan 2004 22:26:09 +0000 (22:26 +0000)
committerSterling Hughes <sterling@php.net>
Fri, 16 Jan 2004 22:26:09 +0000 (22:26 +0000)
shane and rob richards.  there were a lot of race conditions with regards
to the way namespaces have been handled in XML documents so far, this new
method removes the race conditions, and gives me a real reason to add the
children() and attributes() methods.

ext/simplexml/tests/profile04.phpt
ext/simplexml/tests/profile05.phpt
ext/simplexml/tests/profile06.phpt
ext/simplexml/tests/profile07.phpt
ext/simplexml/tests/profile10.phpt
ext/simplexml/tests/profile11.phpt

index bc15968eaa740f64b2d4c4a0b4f7582dadd2f470..7b7245de4f0a0c538f612bd5e34ca09a858cbf24 100644 (file)
@@ -10,7 +10,7 @@ $root = simplexml_load_string('<?xml version="1.0"?>
 </root>
 ');
 
-echo $root->reserved->child;
+echo $root->children('reserved')->child;
 echo "\n---Done---\n";
 ?>
 --EXPECT--
index d4f651b57ee35d2808d778c63837626fc23ae941..217ac670529b43e977e9c1b09400b94538c5f1c3 100644 (file)
@@ -13,8 +13,8 @@ $root = simplexml_load_string('<?xml version="1.0"?>
 
 $root->register_ns('myns', 'reserved-ns');
 
-echo $root->myns->child;
-echo $root->reserved->child;
+echo $root->children('myns')->child;
+echo $root->children('reserved')->child;
 echo "\n---Done---\n";
 ?>
 --EXPECT--
index e1817f30a9cb5df2a7b013658f3877b6cfeec313..4e9421a2a35fc49167d2bb448d8aeca3add3b433 100644 (file)
@@ -11,7 +11,7 @@ $root = simplexml_load_string('<?xml version="1.0"?>
 </root>
 ');
 
-echo $root->child['reserved:attribute'];
+echo $root->child->attributes('reserved')['attribute'];
 echo "\n---Done---\n";
 ?>
 --EXPECT--
index b76e6ddc9590225f87ef56853beacb058d8d9a32..51ffb8efb32ab731d23e04215fd12a98e26b0303 100644 (file)
@@ -13,8 +13,8 @@ $root = simplexml_load_string('<?xml version="1.0"?>
 
 $root->register_ns('myns', 'reserved-ns');
 
-echo $root->child['reserved:attribute'];
-echo $root->child['myns:attribute'];
+echo $root->child->attributes('reserved')['attribute'];
+echo $root->child->attributes('myns')['attribute'];
 echo "\n---Done---\n";
 ?>
 --EXPECT--
index 747b056fcb1d8575f144089ef775888a26c1e88a..06beee851ef938f642a5d06db98270e41a35349f 100644 (file)
@@ -11,9 +11,9 @@ $root = simplexml_load_string('<?xml version="1.0"?>
 </root>
 ');
 
-echo $root->child['reserved:attribute'];
+echo $root->child->attributes('reserved')['attribute'];
 echo "\n";
-echo $root->child['special:attribute'];
+echo $root->child->attributes('special')['attribute'];
 foreach ($root->child['attribute'] as $attr) {
        echo "$attr\n";
 }
index f9dd2dc58e6ea848c3a89fc17098fb673c560da9..c5d764f1b2767e74eb03a8f98d0d8b84552bfd1c 100644 (file)
@@ -12,9 +12,9 @@ $root = simplexml_load_string('<?xml version="1.0"?>
 </root>
 ');
 
-echo $root->reserved->child;
+echo $root->children('reserved')->child;
 echo "\n";
-echo $root->special->child;
+echo $root->children('special')->child;
 foreach ($root->child as $child) {
        echo "$child\n";
 }