Simple HTML classes

Keith Dart kdart at kdart.com
Wed Jul 31 07:43:51 EDT 2002


In article <47ptjushoni8bfqurttm86sgt8bm6tge84 at 4ax.com>, "Dale
Strickland-Clark" <dale at riverhall.nothanks.co.uk> penned these words:

> We need a bunch of light-weight HTML classes to build web pages -
> especially forms. These will work with the CGI module so that the forms
> related classes are bi-directional.
> 
> Before we start writing them them, I was wondering if anyone had done
> anything similar or there was a module I'd overlooked.
> 
> I can't believe this hasn't been tackled before.
> 
> Thanks
> --
> Dale Strickland-Clark
> Riverhall Systems Ltd


The pyNMS package has an HTML package (sub-package) that allows generating
HTML from Python objects. Actually, it is XHTML 4.1. This uses my Python
Object Model (POM) for XML file creation, parsing,  and manipulation that
is similar in concept to DOM. Actually, you can construct any XML document
with that, and the HTML package is just a subset of that (uses the
"compiled" XHTML DTDs).

Should you ever need to update to a newer version of XHTML, just run the
dtd2py program on the new DTD file. You instantly get all newly defined
elements and attributes. 

http://pynms.sourceforge.net/

download the release, and look at the lib/POM.py and lib/HTML/__init__.py
files. You can construct any document using the "generic" constructor
methods, or use the more convenient "helper" methods for some elements.
More helper methods need to be added, however. 

Hope this helps,
Keith


-- 
--                           ^
                           \/ \/
                           (O O)
-- --------------------oOOo~(_)~oOOo----------------------------------------
Keith Dart
<mailto:kdart at kdart.com> 
<http://www.kdart.com/>  
----------------------------------------------------------------------------
Public key ID: B08B9D2C Public key: <http://www.kdart.com/~kdart/public.key>
============================================================================



More information about the Python-list mailing list