Sorry for bringing this old topic up, but I was just playing with ElementTree yesterday and I made a link to this
I believe your model can be implemented on top of ElementTree, to give it a more friendly interface.
class RSS2( XMLModel ):
class XMLAttrs:
_tagname = 'rss'
version = '2.0'
class channel( XMLNode ):
title = XMLString()
description = XMLString()
link = XMLString()
lastBuildDate = XMLDate( format = "%a, %d %b %Y %H:%M:%S EST" )
generator = XMLString()
docs = XMLString()
class item( XMLNodeList ):
title = XMLString()
link = XMLString()
description = XMLString()
category = XMLList( type = XMLString() )
pubDate = XMLDate( format = "%a, %d %b %Y %H:%M:%S EST" )
Based on your example
all the helper classes extend the Element
So all that needs to be done is a render function that will take your class and do some calls to SubElement
One question, how will you manage optional elements in the template?
how is that?
on the other hand I remenber looking at http://manatlan.online.fr/hypy.php it's something similar but based on indentation no classes.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

