parsing multiple root element XML into text

Alain Ketterlin alain at dpt-info.u-strasbg.fr
Fri May 9 13:16:35 EDT 2014


Marko Rauhamaa <marko at pacujo.net> writes:

> Alain Ketterlin <alain at dpt-info.u-strasbg.fr>:
>
>> which does an exact traversal of potential the DOM tree... (assuming a
>> DOM is even defined on a non well-formed XML document).
>>
>> Anyway, my point was only to warn the OP that he is not doing XML.
>
> I consider that one of the multitude of flaws in XML.

I consider such use cases one of the multitude misuses of XML.

> Compare that with the close analogue: S expressions. [...]

How do you specify the encoding of sexprs? How can you require that an
attribute value must match the value of an id-attribute? or whatever
insanely complex integrity rule that XML Schemas lets you express? And
so on.

If all you need to do is parse properly bracketed input, go with sexprs,
or json, or yaml, or pickle if both ends are python programs. Using XML
for such a trivial task is looking for trouble.

-- Alain.



More information about the Python-list mailing list