parsing multiple root element XML into text

Stefan Behnel stefan_ml at behnel.de
Fri May 9 15:46:04 EDT 2014


Marko Rauhamaa, 09.05.2014 20:04:
> I think the worst part of XML is that you can't parse it without a DTD
> or schema.

Nonsense.


> I was very hopeful about json until I discovered they require the parser
> to dynamically support five different character encodings.
> 
> XML at least standardized on UTF-8.

Not really. Definitely not "standardized". It's just the default if there
is no explicit encoding or BOM. That doesn't keep you from passing around
XML in EBCDIC, if you feel like it.


> I have found ast.literal_eval() to be highly usable.

Well, there's json.loads(), which is more commonly used for this task.

Stefan





More information about the Python-list mailing list