[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XML Parsing with Encoded Characters



   I'm downloading a SOAP message from a webservice where the body
   contains an xml document.  The xml tags (< >) within the body of the
   message are being escaped.  This is causing a problem with the xml
   parser.  While searching for an answer as to how to handle this, I
   came across another thread on this mailing list where Scott explained
   how to handle the situation.  This is from the other thread:
<soap:Envelope whatever-whatever>
   <soap:Body whatever>
     &lt;ADStart&gt;&lt;error code="0" text="NO_ERROR"
     /&gt;&lt;ticket&gt;fe81cb7e-fd9e-411b-b3fd-b9c5729728f7
     &lt;/ticket&gt;&lt;/ADStart&gt;
   </soap:Body>
</soap:Envelope>

What I mean is... are the <, > and & characters escaped so that they
won't be treated as XML tags, as they are in the above example?  If so,
that's a very common issue.  The solution is to have the contents of the
'Body' element saved to a file (or a string if it's small enough) and
then parse that file/string separately using http_parse_xml_stmf() or
http_parse_xml_string()

   I've taken the body portion of the message and placed it into a
   separate streamfile and am using http_parse_xml_stmf() to parse that
   file.   However, this still doesn't work.  Should the xml tags be
   un-escaped in order for the parser work?  Or is there another
   solution?
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------