Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to unescape tags without unescaping content
    primarykey
    data
    text
    <p>How can I unescape only the tags but not the content? Let me explain on an example...</p> <p>This is the original raw response:</p> <pre><code>&amp;lt;GetWhoISResponse xmlns=&amp;quot;http://www.webservicex.net&amp;quot;&amp;gt; &amp;lt;GetWhoISResult&amp;gt;Whois Server Version 2.0 To single out one record, look it up with &amp;quot;xxx&amp;quot;, where xxx is one of the of the records displayed above. If the records are the same, look them up with &amp;quot;=xxx&amp;quot; to receive a full display for each record. &amp;gt;&amp;gt;&amp;gt; Last update of whois database: Mon, 30 Dec 2013 08:20:00 UTC &amp;lt;&amp;lt;&amp;lt; NOTICE: The expiration date displayed in this record is the date the registrar&amp;apos;s sponsorship of the domain name registration in the registry is currently set to expire. This date does not necessarily reflect the expiration date of the domain name registrant&amp;apos;s agreement with the sponsoring registrar. Users may consult the sponsoring registrar&amp;apos;s Whois database to view the registrar&amp;apos;s reported date of expiration for this registration. &amp;lt;/GetWhoISResult&amp;gt; &amp;lt;/GetWhoISResponse&amp;gt; </code></pre> <p>If I use StringEscapeUtils and unescape text (unescapeXml):</p> <pre><code>&lt;GetWhoISResponse xmlns="http://www.webservicex.net"&gt; &lt;GetWhoISResult&gt;Whois Server Version 2.0 To single out one record, look it up with "xxx", where xxx is one of the of the records displayed above. If the records are the same, look them up with "=xxx" to receive a full display for each record. &gt;&gt;&gt; Last update of whois database: Mon, 30 Dec 2013 08:20:00 UTC &lt;&lt;&lt; NOTICE: The expiration date displayed in this record is the date the registrar's sponsorship of the domain name registration in the registry is currently set to expire. This date does not necessarily reflect the expiration date of the domain name registrant's agreement with the sponsoring registrar. Users may consult the sponsoring registrar's Whois database to view the registrar's reported date of expiration for this registration. &lt;/GetWhoISResult&gt; &lt;/GetWhoISResponse&gt; </code></pre> <p>The problem is in the middle, in the line where <code>&lt;</code> and <code>&gt;</code> are escaped. I need this, because I would like to convert this to JSON, but now I get parsing error.</p>
    singulars
    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.
    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