[Zope-dev] Page Templates: handling ick from MS applications

Christopher N. Deckard cnd@ecn.purdue.edu
Fri, 29 Mar 2002 15:09:30 -0500


This has been submitted to the collector...  I have also uploaded a
sample patch.

http://collector.zope.org/Zope/321

We have set up a PUT_factory to create Page Templates 
out of files PUT through WebDAV with a content type 
of 'text/html'. This works all fine and dandy until 
we run across bad HTML from MS Office XP applications 
(specifically PowerPoint XP). The problems are in 
TAL/HTMLParser.py.

An example of badness:
<!--[if gte mso 9]>
or
<![endif]-->

This causes the Page Template renderer to break. 
I have a sample patch wich seems to work. Some of 
the new stuff should probably be renamed as it 
slams MS. :-)

Another error occurs due to a bug in TAL/markupbase.py. 
The call to error() when we have a bad declaration 
name to scan. Two parameters were being passed to 
self.error and it only takes one (plus self).

Attached in a file are two patches which seem to fix 
the problems. I'll also include the PUT_factory that
I'm using in case you want to test with it. If you need
a sample PowerPoint XP file, let me know and I can put 
one up for you.

-Chris 
-- 
--------------------------------------------------------------------
    Christopher N. Deckard      |     Lead Web Systems Developer
      cnd@ecn.purdue.edu        |    Engineering Computer Network
  http://www.ecn.purdue.edu/    |         Purdue University 
---- zlib.decompress('x\234K\316Kq((-J)M\325KM)\005\000)"\005w') ---