newlines and sax.saxutils.quoteattr

Fredrik Lundh fredrik at pythonware.com
Tue Sep 19 17:57:13 CEST 2006


Edward K. Ream wrote:

> - Does anyone know whether this is guaranteed to be a general solution? That 
> is, are sax parsers *obliged* to ignore newlines in attributes?

     http://www.w3.org/TR/REC-xml/#AVNormalize

> - If sax parsers are indeed obliged to ignore newlines in attributes, would 
> it be a good idea to (optionally?) have sax.saxutils.quoteattr perform the 
> substitution of newlines to '
\n' ?

perhaps.  a really good idea would be store free-format text in 
elements, not attributes, but I guess it's too late to fix OPML.

</F>




More information about the Python-list mailing list