Hello, I have to import existing HTML pages into Zope and use them as Page Templates. The problem I have is that many or most of these pages are not proper HTML and they are (rightly so) refused by the TAL HTML parser. Do you know of any simple way to clean up the original HTML? I was thinking of HTML Tidy, or something similar, used as a Web service or installed locally. Any idea greatly appreciated. Thanks, Robert __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
You don't say why you need to put the existing HTML into TAL. Why not serve the old malformed HTML (that works) directly and use TAL and/or DTML to invoke it. I use this approach to good effect. I actually store the HTML in the local file system and access it through LocalFS. Over time you can migrate HTM to TAL as features are added, etc. On Tue, 19 Aug 2003, Robert Jean wrote:
Hello,
I have to import existing HTML pages into Zope and use them as Page Templates. The problem I have is that many or most of these pages are not proper HTML and they are (rightly so) refused by the TAL HTML parser.
Do you know of any simple way to clean up the original HTML? I was thinking of HTML Tidy, or something similar, used as a Web service or installed locally.
Any idea greatly appreciated. Thanks,
Robert
__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Dennis, Thanks for your response. I don't understand what you mean by "use TAL and/or DTML to invoke it". Invoke what? The old malformed HTML has to be rendered by TAL, because after being imported, it is modified and contains a few TAL macros. Robert --- Dennis Allison <allison@sumeru.stanford.EDU> wrote:
You don't say why you need to put the existing HTML into TAL. Why not serve the old malformed HTML (that works) directly and use TAL and/or DTML to invoke it. I use this approach to good effect. I actually store the HTML in the local file system and access it through LocalFS. Over time you can migrate HTM to TAL as features are added, etc.
On Tue, 19 Aug 2003, Robert Jean wrote:
Hello,
I have to import existing HTML pages into Zope and use them as Page Templates. The problem I have is that many or most of these pages are not proper HTML and they are (rightly so) refused by the TAL HTML parser.
Do you know of any simple way to clean up the original HTML? I was thinking of HTML Tidy, or something similar, used as a Web service or installed locally.
Any idea greatly appreciated. Thanks,
Robert
__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
On Tue, Aug 19, 2003 at 09:19:18AM -0700, Robert Jean wrote:
Dennis,
Thanks for your response.
I don't understand what you mean by "use TAL and/or DTML to invoke it". Invoke what?
maybe he meant import the old stuff as a File or a DTML method or some such, then in another ZPT do a <foo tal:replace="structure here/broken_html_thingie" />
The old malformed HTML has to be rendered by TAL, because after being imported, it is modified and contains a few TAL macros.
ah, ok. If it's really necessary to do this on the server side, I'd make an upload form, have its target be an an External Method that does roughly this: - pipe the file data to and from Tidy, probably using os.popen2(). (there's an option for Tidy to create valid XHTML, use that.) - create a ZPT from the cleaned up output. (probably the id to use is one of the parameters passed from your upload form...) But, if you are doing a bunch at once, easier would be to just run Tidy on the filesystem and then upload the results to zope... -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's THE POUNCING PADDLE! (random hero from isometric.spaceninja.com)
Do you know of any simple way to clean up the original HTML? I was thinking of HTML Tidy, or something
I thinl Tidy is the right way to go. Probably a local install is best, but it you really want, you could probably use http://cgi.w3.org/cgi-bin/tidy --jcc -- "My point and period will be throughly wrought, Or well or ill, as this day's battle's fought."
participants (4)
-
Dennis Allison -
J Cameron Cooper -
Paul Winkler -
Robert Jean