https://github.com/waveform80/elementtreefactory
An extension to ElementTree inspired by Genshi's ElementFactory
https://github.com/waveform80/elementtreefactory
Last synced: 10 months ago
JSON representation
An extension to ElementTree inspired by Genshi's ElementFactory
- Host: GitHub
- URL: https://github.com/waveform80/elementtreefactory
- Owner: waveform80
- License: mit
- Created: 2011-11-26T22:06:28.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-11-27T19:51:23.000Z (over 14 years ago)
- Last Synced: 2025-04-13T03:54:23.133Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 102 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
- License: COPYING.txt
Awesome Lists containing this project
README
Still gotta write this. For now, I'll assume you know what you're doing and let
the code do the talking:
$ easy_install ElementTreeFactory
Then in your python code:
import xml.etree.ElementTree as et
from ElementTreeFactory import tag
print et.tostring(
tag.html(
tag.head(
tag.link(rel='stylesheet', href='default.css', type_='text/css', media='screen'),
tag.title('This is a test document'),
),
tag.body(
tag.h1('Welcome to ElementTreeFactory'),
tag.p('This is a short demonstration of usage of ElementTreeFactory', class_='bodytext'),
tag.ul(
tag.li('Item %d' % n)
for n in range(5)
)
)
)
)