[Twisted-Python] XMLString clarification
I'm still having trouble getting my multipart text/html from an email into XMLString. I run the html through beautifulsoup then remove the doctype, but if there's anything at all off about the resulting xml it still craps out. Is there anyway to stick an arbitrary string into a template? Or should I add a callback to flatten and add the placeholder in the flatten stage and replace the placeholder with the actually html. Any guidance appreciated, Kevin
Hi Kevin On 4/8/14 9:34 AM, Kevin Mcintyre wrote:
I'm still having trouble getting my multipart text/html from an email into XMLString.
I run the html through beautifulsoup then remove the doctype, but if there's anything at all off about the resulting xml it still craps out.
How? Traceback?
Is there anyway to stick an arbitrary string into a template? Or should I add a callback to flatten and add the placeholder in the flatten stage and replace the placeholder with the actually html.
Werner
I've opted for placeholder and added callback to flatten. I'm a hack, and it was holding up delivery of email. On Tue, Apr 8, 2014 at 4:19 PM, Werner Thie <werner@thieprojects.ch> wrote:
Hi Kevin
On 4/8/14 9:34 AM, Kevin Mcintyre wrote:
I'm still having trouble getting my multipart text/html from an email into XMLString.
I run the html through beautifulsoup then remove the doctype, but if there's anything at all off about the resulting xml it still craps out.
How? Traceback?
Is there anyway to stick an arbitrary string into a template? Or should
I add a callback to flatten and add the placeholder in the flatten stage and replace the placeholder with the actually html.
Werner
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
I will try to get a test class together to demonstrate. On Tue, Apr 8, 2014 at 4:38 PM, Kevin Mcintyre <kebin70@gmail.com> wrote:
I've opted for placeholder and added callback to flatten.
I'm a hack, and it was holding up delivery of email.
On Tue, Apr 8, 2014 at 4:19 PM, Werner Thie <werner@thieprojects.ch>wrote:
Hi Kevin
On 4/8/14 9:34 AM, Kevin Mcintyre wrote:
I'm still having trouble getting my multipart text/html from an email into XMLString.
I run the html through beautifulsoup then remove the doctype, but if there's anything at all off about the resulting xml it still craps out.
How? Traceback?
Is there anyway to stick an arbitrary string into a template? Or should
I add a callback to flatten and add the placeholder in the flatten stage and replace the placeholder with the actually html.
Werner
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
On Apr 8, 2014, at 7:38 PM, Kevin Mcintyre <kebin70@gmail.com> wrote:
I've opted for placeholder and added callback to flatten.
I'm a hack, and it was holding up delivery of email.
What I would do is use html5lib to parse the HTML, then emit it as HTML before re-parsing it as XML. XMLString is designed to read templates written by a programmer, not arbitrary garbage HTML off the internet. There are other libraries for that :-). -glyph
participants (3)
-
Glyph -
Kevin Mcintyre -
Werner Thie