Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP - parse data from a SOAP response
    primarykey
    data
    text
    <p>I'm using the W3 validator API, and I get this kind of response:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"&gt; &lt;env:Body&gt; &lt;m:markupvalidationresponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:m="http://www.w3.org/2005/10/markup-validator"&gt; &lt;m:uri&gt;http://myurl.com/&lt;/m:uri&gt; &lt;m:checkedby&gt;http://validator.w3.org/&lt;/m:checkedby&gt; &lt;m:doctype&gt;-//W3C//DTD XHTML 1.1//EN&lt;/m:doctype&gt; &lt;m:charset&gt;utf-8&lt;/m:charset&gt; &lt;m:validity&gt;false&lt;/m:validity&gt; &lt;m:errors&gt; &lt;m:errorcount&gt;1&lt;/m:errorcount&gt; &lt;m:errorlist&gt; &lt;m:error&gt; &lt;m:line&gt;7&lt;/m:line&gt; &lt;m:col&gt;80&lt;/m:col&gt; &lt;m:message&gt;character data is not allowed here&lt;/m:message&gt; &lt;m:messageid&gt;63&lt;/m:messageid&gt; &lt;m:explanation&gt; &lt;![CDATA[ PAGE HTML IS HERE ]]&gt; &lt;/m:explanation&gt; &lt;m:source&gt;&lt;![CDATA[ HTML AGAIN ]]&gt;&lt;/m:source&gt; &lt;/m:error&gt; ... &lt;/m:errorlist&gt; &lt;/m:errors&gt; &lt;m:warnings&gt; &lt;m:warningcount&gt;0&lt;/m:warningcount&gt; &lt;m:warninglist&gt; &lt;/m:warninglist&gt; &lt;/m:warnings&gt; &lt;/m:markupvalidationresponse&gt; &lt;/env:Body&gt; &lt;/env:Envelope&gt; </code></pre> <p>How can I extract some variables from there?</p> <p>I need <code>validity</code>, <code>errorcount</code> and if possible from the list of errors: <code>line</code>, <code>col</code>, and <code>message</code> :)</p> <p>Is there a easy way to do this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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