Regular Expressions: Can't quite figure this problem out

Robert Dailey rcdailey at gmail.com
Wed Sep 26 11:51:55 EDT 2007


Even better! Now I can drop the regular expression that did the same thing
:)

Thanks!

On 9/26/07, Fredrik Lundh <fredrik at pythonware.com> wrote:
>
> Robert Dailey wrote:
>
> > Hmm, ElementTree.tostring() also adds a space between the last character
> > of the element name and the />. Not sure why it is doing this.
>
> ET is commonly used to generate (X)HTML fragments, and that space
> provides partial HTML compatibility.
>
> since the default serializer never generates CDATA sections, it should
> be safe to simply do a text.replace(" />", "/>") on the resulting string.
>
> </F>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070926/5c9f1cfc/attachment.html>


More information about the Python-list mailing list