urllib2 and Xml

John J. Lee jjl at pobox.com
Thu Oct 9 21:22:36 EDT 2003


Glauco <glauco at sferacarta.com> writes:

> I'm building a library than can call a remote sistem in SOAP or in
> HTML for retrieve XML information.
> when i use HTML (httppost) with urllib2 i've this problem:
> 
> if the response is  something like this
> <?xml version="1.0" encoding="utf-8"?><string
> xmlns="http://bdr.izs.it/webservices"><root
> xmlns="http://bdr.izs.it/XMLSchema/ResponseQuery.xsd"
> type="doc"><error_info><error><id /><des
> /></error><info>162</info><warning
> /></error_info>&
>    <FIELD1>
>      <FIELD2>14438756</FIELD2>
>      <FIELD3>36587707</FIELD3>
> 
> obviously  is htmlquoted but this is uncomprensible from expat or minidom.
> i can manually htmlunquote but this don't like me.
> i've tyed whith urllib.unquote but this don't do nothing
> Is possible that urllib2 dont do this  ?

This has nothing to do with urllib2.  It's just faithfully telling you
what the server sent.  Dealing with whatever crap that may include is
your problem <wink>.


John




More information about the Python-list mailing list