Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to put the xml header, with "<?xml" in php
    text
    copied!<p>First of all: I'm new with the <code>SimpleXMLElement</code> object, so maybe i'm doing something wrong.</p> <p>I have to load this string:</p> <pre><code>$xmlTipologie=simplexml_load_string(html_entity_decode("&lt;?xml version='1.0' encoding='utf-8'?&gt;&lt;content&gt;".$temp_dom-&gt;saveHTML()."&lt;/content&gt;", null, "UTF-8")); </code></pre> <p>But this is the error I get:</p> <pre><code>Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : StartTag: invalid element name in ....content/plugins/soap-SGS/soap-SGS.php on line 115 </code></pre> <p>Without adding the header of the xml I get this error. Maybe there is another way to add the header of a xml in a php string, and if there is I'd be happy that you wrote below, but now I'm curious of another thing:</p> <p>How can i put this char -> <code>&lt;?</code> in a php string? "Obvious when the short tag mode is set on the php.ini?)</p> <p>Edit, i use htmlspecialchars in this way:</p> <pre><code> $xmlTipologie=simplexml_load_string("&lt;?xml version='1.0' encoding='utf-8'?&gt;".htmlspecialchars("&lt;content&gt;&lt;![CDATA[".$temp_dom-&gt;saveHTML()."]]&gt;&lt;/content&gt;",ENT_QUOTES)); </code></pre> <p>And this is the new error: </p> <blockquote> <p>Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Start tag expected, '&lt;' not found in /Users/paolo.cargnin/Sites/happycamp/wp-content/plugins/soap-SGS/soap-SGS.php on line 116</p> </blockquote> <p>Mh... I can't debug it and this hurt me a lot.</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload