views:

147

answers:

2

Hello,

is there any python module or code that implements the org.apache.commons.lang.StringEscapeUtils.escapeHtml ?

exactly the same as in http://commons.apache.org/lang/api/org/apache/commons/lang/StringEscapeUtils.html#escapeHtml(java.lang.String)

i googled around but could only find the cgi.escape function that doesn't do the same thing.

thanks in advance, sorry for the english :D

A: 

This is for XML and not for HTML, but it might fit your needs: Escaping XML

>>> from xml.sax.saxutils import escape
>>>
>>> escape("< & >")
'&lt; &amp; &gt;'
Otto Allmendinger
unfortunately this does not work...the good thing is that i've found something that work in http://www.peterbe.com/plog/html-entity-fixerthanks for the help
Túlio Caraciolo
A: 

i've found something that work in peterbe.com/plog/html-entity-fixer thanks for the help

Túlio Caraciolo