[Zope] Why not ZPT and jaxml instead

Peter Bengtsson mail@peterbe.com
Fri, 09 Aug 2002 10:05:28 +0100


--=======241958B3=======
Content-Type: text/plain; x-avg-checked=avg-ok-7E4D7258; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 8bit


>
>The following can be understood by all pyhton programmers:
>
>"""
>  <html>
>   <head>
>    <title>%s</title>
>   </head>
>   <body>
>    <h1>%s</h1>
>   </body>
>  </html>
>""" % (mytitle, myheading)

It's never this easy unless it's the simplest of applications :)

Speaking of which... Consider using jaxml and the HTML_document class 
there. Search google for "jaxml".
Basically It works like this:

 >>> import jaxml
 >>> h=jaxml.HTML_document()
 >>> h.html()
 >>> h.head()
 >>> h.title()
 >>> h._text("Hello world")
 >>> h._pop()
 >>> h.meta(type="something", refresh="1")
 >>> print h
<?xml version="1.0" encoding="iso-8859-1"?>
<html>
     <head>
         <title>
             <text>Hello world</text>
             Hellow world
         </title>
     </head>
     <meta refresh="1" type="something" />
</html>


I use this module to generate XML and it works great! For HTML I'm not too 
sure but it appears to be working just fine.


--=======241958B3=======
Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-7E4D7258
Content-Disposition: inline


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.380 / Virus Database: 213 - Release Date: 2002-07-24

--=======241958B3=======--