README 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. SimpleXML is meant to be an easy way to access XML data.
  2. SimpleXML objects follow four basic rules:
  3. 1) properties denote element iterators
  4. 2) numeric indices denote elements
  5. 3) non numeric indices denote attributes
  6. 4) string conversion allows to access TEXT data
  7. When iterating properties then the extension always iterates over
  8. all nodes with that element name. Thus method children() must be
  9. called to iterate over subnodes. But also doing the following:
  10. foreach ($obj->node_name as $elem) {
  11. // do something with $elem
  12. }
  13. always results in iteration of 'node_name' elements. So no further
  14. check is needed to distinguish the number of nodes of that type.
  15. When an elements TEXT data is being accessed through a property
  16. then the result does not include the TEXT data of subelements.
  17. Known issues
  18. ============
  19. Due to engine problems it is currently not possible to access
  20. a subelement by index 0: $object->property[0].
  21. TODO
  22. ====
  23. At the moment property access to multiple elements of the same
  24. name returns an array of SimpleXML objects. This should be an
  25. object of a new type instead so that all kinds of linkage,
  26. assignment and deleting would work.