note 110269 deleted from soapvar.soapvar by danbrown
| From: | danbrown@php.net | Date: | Wed, 17 Oct 2012 21:26:59 +0000 |
| Subject: | note 110269 deleted from soapvar.soapvar by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191402@lists.php.net to get a copy of this message | ||
Note Submitter: effectiveit at online dot nl
----
A better way of circumventing the bug in SoapVar (not being able to parse an XML string including a
declaration) is the following:
// create a DOMDocument $dom first
$nodes = $dom -> getElementsByTagName ('anyElement');
$node = $nodes -> item(0);
$result = new SoapVar ($dom -> saveXML($node), XSD_ANYXML, null, null, 'Res', 'http://pse/');
Normally, anyElement will be the root element of the DOM.
saveXML() without parameters will include the declaration in the resulting string, whereas saveXML
with a paramater saves the DOM in a string without the declaration, so this is parsable by SoapVar.