note 110269 added to soapvar.soapvar

From: Date: Sat, 06 Oct 2012 11:41:04 +0000
Subject: note 110269 added to soapvar.soapvar
Groups: php.notes 
Request: Send a blank email to php-notes+get-191159@lists.php.net to get a copy of this message
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. ---- Server IP: 69.147.83.199 Probable Submitter: 82.157.160.232 ---- Manual Page -- http://www.php.net/manual/en/soapvar.soapvar.php Edit -- https://master.php.net/note/edit/110269 Del: integrated -- https://master.php.net/note/delete/110269/integrated Del: useless -- https://master.php.net/note/delete/110269/useless Del: bad code -- https://master.php.net/note/delete/110269/bad+code Del: spam -- https://master.php.net/note/delete/110269/spam Del: non-english -- https://master.php.net/note/delete/110269/non-english Del: in docs -- https://master.php.net/note/delete/110269/in+docs Del: other reasons-- https://master.php.net/note/delete/110269 Reject -- https://master.php.net/note/reject/110269 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#191159) next »