On 2/8/07, venkatbo <[EMAIL PROTECTED]> wrote: > > Hi all, > > One of the (legacy) apps providing content to my TG-app is > handing off "non well-formed" html. I'm unable to get the kid > template engine to accept the html snippet without runtime > errors. Following is a sample reflecting some of the violations > (no closing tags for example): > > --------------- > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN" > "http://www.w3.org/TR/html32.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:py="http://purl.org/kid/ns#" py:extends="'master.kid'"> > <HEAD> > <META content="text/html; charset=UTF-8" > http-equiv="content-type" py:replace="''" /> > <TITLE>Non Well-formed HTML</TITLE> > </HEAD> > <BODY> > > <!-- Non well-formed content from here ... --> > <H1>Stores</H1> > <H2>Ratings</H2> > <STORES> > <DL> > <H4>Top stores as of: ${now}</H4> > <DT><A HREF=http://www.amazon.com>Amazon</A> - Store 1. > <DT><A HREF=http://www.circuitcity.com>Circuit City</A> - > Store 2. > <P> > <DT><A HREF=http://www.outpots.com>FRY's</A> - Store 3. > </DL> > </STORES> > <HR> > <H3>References:</H3> > <OL> > <LI><A HREF=http://www.cnet.com>CNet</A> - Reviews. > <LI><A HREF=http://www.consumerreports.org>Consumer Reports</A> > - Evals and recos. > </OL> > <!-- ... to here --> > > </BODY> > </html> > --------------- > > I tried all HTML DOCTYPES listed at: > http://www.htmlhelp.com/tools/validator/doctype.html > especially HTML 2.0, 3.2 and 4.01. At the controllers, I've specified > the format as "html" for the template-including expose() decorator. > > The exception includes, for example: > ExpatError: not well-formed (invalid token): line 18, column 20 > which is basically that the href urls are not in quotes. > > Does anyone have an idea if its possible to have such ill-formed html > in a kid template ? > > If not, is "tidy" (CP filter) the way to go or does one have to use > regex > to programmatically "clean" up all such missing quotes, open-tags-only > etc.
Try using elementtidy. -bob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---