[Zope] Cleaning HTML for use as ZPT

volker.wend at efgbsh.de volker.wend at efgbsh.de
Wed Aug 20 22:35:55 EDT 2003


Just to clarify: Robert Jean is trying to use my IE Addon. It hooks into the
ZMI for PageTemplates and provides a Visual Editor using the Microsoft
Richtext Edit Control.

In my opinion he has two options: clean up the HTML with TIDY or use a
different Object to store the HTML Code and adjust the Edit Control.

I would probably choose the later but it depends if needs the TAL Macros....

Regards,
Volker Wend


-----Original Message-----
From: Paul Winkler [mailto:pw_lists at slinkp.com] 
Sent: Dienstag, 19. August 2003 18:25
To: zope at zope.org
Subject: Re: [Zope] Cleaning HTML for use as ZPT


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)

_______________________________________________
Zope maillist  -  Zope at 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 )



More information about the Zope mailing list