[go: up one dir, main page]

Menu

[r25]: / ooolib-python-dev / html.py  Maximize  Restore  History

Download this file

26 lines (20 with data), 519 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python
import ooolibXML
# Create a test web page
html = ooolibXML.Element('html')
# Create head
head = ooolibXML.Element('head')
title = ooolibXML.Element('title')
title.setData('My Document')
head.addChild(title)
html.addChild(head)
# Create body
body = ooolibXML.Element('body')
body.setAttribute('bgcolor', '#ffffff')
body.setAttribute('background', 'images/back.gif')
h1 = ooolibXML.Element('h1')
h1.setData('My Document')
body.addChild(h1)
html.addChild(body)
# Display results
html.printXML()