From 9e29f17493284dee81d2842f6067b24fba9538a5 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sat, 17 Jan 2004 19:41:32 +0000 Subject: Major bugfix for consistency. # After long discussions we came to a conclusion on how to make this # extension consistent in itself. # Thanks to Rob for all the work --- ext/simplexml/README | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'ext/simplexml/README') diff --git a/ext/simplexml/README b/ext/simplexml/README index 9a867157f2..f99f6ac3c9 100755 --- a/ext/simplexml/README +++ b/ext/simplexml/README @@ -2,18 +2,23 @@ SimpleXML is meant to be an easy way to access XML data. SimpleXML objects follow four basic rules: -1) properties denote elements +1) properties denote element iterators 2) numeric indices denote elements 3) non numeric indices denote attributes 4) string conversion allows to access TEXT data +When iterating proerties then the extension always iterates over +all nodes with that elemtnt name. Thus method childen() must be +called to iterate over subnodes. But also doing the following: +foreach $obj->node_name as $elem) { + // do something with $elem +} +Always result in iteration of 'node_name' elements. So no further +check is needed to distinguish the number of nodes of that type. + When an elements TEXT data is being accessed through a property then the result does not include the TEXT data of subelements. -If PHP is compiled with ext/SPL being compiled into the binary -then SimpleXML objects implement the interface RecursiveIterator -so that they can be iterated recursively (http://pecl.php.net/spl). - Known issues ============ -- cgit v1.2.1