mirror of
https://github.com/php/php-src.git
synced 2026-04-14 19:41:05 +02:00
- ext/simplexml/tests/bug25756_1.xml - ext/simplexml/tests/bug25756_2.xml - ext/simplexml/tests/bug25756.xsd Added via503d74aa29and then removed via9e29f17493- ext/mysqli/tests/cacert.pem - ext/mysqli/tests/client-cert.pem - ext/mysqli/tests/client-key.pem Added viae9f9f66f2eand then removed via6d51b7b2e3- ext/gd/tests/simpletext私はガラスを食べられます.jpg Added via3d3f11ede4and never used - ext/gd/tests/src.png Added viacc938b5df0and never used - ext/zlib/tests/gzgetss.test Added viad536ecac5cas a file content of the ext/zlib/tests/gzgetss.gzbut but never used in tests directly. Removed for better clarity of zlib tests - ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl - ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl - ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl Added via1d25fc5c7band never used - ext/reflection/tests/exception.inc Removed via9f8ba2e8a1- ext/phar/tests/files/extracted.inc Removed via549bf83bd1- ext/phar/tests/cache_list/files/extracted.inc Added via05c3104097and never used
SimpleXML is meant to be an easy way to access XML data.
SimpleXML objects follow four basic rules:
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 properties then the extension always iterates over
all nodes with that element name. Thus method children() must be
called to iterate over subnodes. But also doing the following:
foreach ($obj->node_name as $elem) {
// do something with $elem
}
always results 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.
Known issues
============
Due to engine problems it is currently not possible to access
a subelement by index 0: $object->property[0].
TODO
====
At the moment property access to multiple elements of the same
name returns an array of SimpleXML objects. This should be an
object of a new type instead so that all kinds of linkage,
assignment and deleting would work.