note 98946 deleted from simplexmlelement.construct by danbrown
| From: | danbrown@php.net | Date: | Fri, 16 Jul 2010 21:31:04 +0000 |
| Subject: | note 98946 deleted from simplexmlelement.construct by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-170929@lists.php.net to get a copy of this message | ||
Note Submitter: kevinpeno at gmail dot com
----
@zwilson at gulosolutions dot com
The colon ":" is reserved character and denotes a namespaced element in XML.
"soap:envelope" is the element "envelope" contained within the "soap"
namespace.
Thus, SimpleXML is correct in making it's assumption, consequentially "hiding" the
soap prefixed elements.
The problem with SimpleXML is that it wasn't designed for advanced operations and has minimal
support for accessing nodes outside of the global namespace. If you want to access soap:envelope,
you need to register the namespace, via SimpleXMLElement::registerXPathNamespace if it is not
registered in the root node, and perform the lookup using SimpleXMLElement::xpath.
If you want full element lookup support, with namespacing, use DOM or XMLReader.