Re: intolerant HTML parser

2010-02-12 Thread Jim
I want to thank everyone for the help, which I found very useful (the parts that I understood :-) ). Since I think there was some question, it happens that I am working under django and submitting a certain form triggers an html mail. I wanted to validate the html in some of my unit tests. It

Re: intolerant HTML parser

2010-02-10 Thread Lawrence D'Oliveiro
In message 4b712919$0$6584$9b4e6...@newsspool3.arcor-online.net, Stefan Behnel wrote: Usually PyPI. Where do you think these tools come from? They don’t write themselves, you know. -- http://mail.python.org/mailman/listinfo/python-list

Re: intolerant HTML parser

2010-02-09 Thread Stefan Behnel
Lawrence D'Oliveiro, 08.02.2010 22:39: In message 4b6fe93d$0$6724$9b4e6...@newsspool2.arcor-online.net, Stefan Behnel wrote: - generating HTML using a tool that guarantees correct HTML output Where do you think these tools come from? Usually PyPI. Stefan --

Re: intolerant HTML parser

2010-02-08 Thread Stefan Behnel
Jim, 06.02.2010 20:09: I generate some HTML and I want to include in my unit tests a check for syntax. So I am looking for a program that will complain at any syntax irregularities. First thing to note here is that you should consider switching to an HTML generation tool that does this

Re: intolerant HTML parser

2010-02-08 Thread Lawrence D'Oliveiro
In message 4b6fd672$0$6734$9b4e6...@newsspool2.arcor-online.net, Stefan Behnel wrote: Jim, 06.02.2010 20:09: I generate some HTML and I want to include in my unit tests a check for syntax. So I am looking for a program that will complain at any syntax irregularities. First thing to note

Re: intolerant HTML parser

2010-02-08 Thread Stefan Behnel
Lawrence D'Oliveiro, 08.02.2010 11:19: In message 4b6fd672$0$6734$9b4e6...@newsspool2.arcor-online.net, Stefan Behnel wrote: Jim, 06.02.2010 20:09: I generate some HTML and I want to include in my unit tests a check for syntax. So I am looking for a program that will complain at any

Re: intolerant HTML parser

2010-02-08 Thread Phlip
Stefan Behnel wrote: I don't read it that way. There's a huge difference between - generating HTML manually and validating (some of) it in a unit test and - generating HTML using a tool that guarantees correct HTML output the advantage of the second approach being that others have

Re: intolerant HTML parser

2010-02-08 Thread Phlip
and the tweak is: parser = etree.HTMLParser(recover=False) return etree.HTML(xml, parser) That reduces tolerance. The entire assert_xml() is (apologies for wrapping lines!): def _xml_to_tree(self, xml): from lxml import etree self._xml = xml

intolerant HTML parser

2010-02-06 Thread Jim
I generate some HTML and I want to include in my unit tests a check for syntax. So I am looking for a program that will complain at any syntax irregularities. I am familiar with Beautiful Soup (use it all the time) but it is intended to cope with bad syntax. I just tried feeding

Re: intolerant HTML parser

2010-02-06 Thread John Nagle
Jim wrote: I generate some HTML and I want to include in my unit tests a check for syntax. So I am looking for a program that will complain at any syntax irregularities. I am familiar with Beautiful Soup (use it all the time) but it is intended to cope with bad syntax. I just tried feeding

Re: intolerant HTML parser

2010-02-06 Thread Jim
Thank you, John. I did not find that by looking around; I must not have used the right words. The speed of the unit tests are not critical so this seems like the solution for me. Jim -- http://mail.python.org/mailman/listinfo/python-list

Re: intolerant HTML parser

2010-02-06 Thread Nobody
On Sat, 06 Feb 2010 11:09:31 -0800, Jim wrote: I generate some HTML and I want to include in my unit tests a check for syntax. So I am looking for a program that will complain at any syntax irregularities. I am familiar with Beautiful Soup (use it all the time) but it is intended to cope