7 Replies Latest reply on May 29, 2014 6:34 AM by BreakawayPaul

    How do I deal with an XML file that uses html characters?

    BreakawayPaul Level 2

      I need to pull a userlist for my web app, and that involves invoking a web service on the authentication server.  I've managed to do just that, but the XML file I'm given to deal with looks like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body><ns1:getAllUserInfoResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://web.ws">
      <getAllUserInfoReturn xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      &lt;?xml version = '1.0'?&gt;
      &lt;USER&gt;
      &lt;ROW num=&quot;1&quot;&gt;
      &lt;USER_ID&gt;25214&lt;/USER_ID&gt;
      &lt;LOGIN_ID&gt;JDOE&lt;/LOGIN_ID&gt;
      &lt;NAME_LAST&gt;JOHN&lt;/NAME_LAST&gt;
      &lt;NAME_FIRST&gt;DOE&lt;/NAME_FIRST&gt;
      &lt;NAME_MI&gt;Q&lt;/NAME_MI&gt;
      &lt;NAME_FI&gt;A&lt;/NAME_FI&gt;
      &lt;EMAIL&gt;john.doe@email.com&lt;/EMAIL&gt;
      &lt;OFFICE_PHONE&gt;5551212&lt;/OFFICE_PHONE&gt;
      &lt;OFFICE_STREET1&gt;123 Main Street&lt;/OFFICE_STREET1&gt;
      &lt;/ROW&gt; &lt;/USER&gt; 
      ( etc )
      </getAllUserInfoReturn>
      </ns1:getAllUserInfoResponse>
      </soapenv:Body>
      </soapenv:Envelope> 
      

       

      I need to loop through this and get usernames, ids, rights, etc, but with it looking like that, I have my work cut out for me (I think).  I'm not sure if there's an easy way to replace entities in an XML file (the docs seem to be down), and if there is, I don't know about it.

       

      Any ideas?