summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2009-12-24 00:38:41 -0500
committerKohei Yoshida <kyoshida@novell.com>2009-12-24 00:38:41 -0500
commitb39172b7ca65111901e278c6b39355f5c782c298 (patch)
tree08198a2d79405898198b3b2f3cd1f74cbf513865 /source
parent8bebd7371adb7f67e5ba6caecf085f221e6c4731 (diff)
Handle list and listitem elements.
Diffstat (limited to 'source')
-rw-r--r--source/docbook.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/docbook.py b/source/docbook.py
index d97dbd5..784e789 100644
--- a/source/docbook.py
+++ b/source/docbook.py
@@ -191,6 +191,27 @@ class DocBookConverter:
# text span should be formatted.
dest.appendContent(src.getContent())
+ elif src.name == 'list':
+ # type may be 'unordered' (bulleted) or 'ordered' (numbered).
+ listType = src.getAttr('type')
+ lnode = None
+ if listType == 'unordered':
+ lnode = dest.appendElement('itemizedlist')
+ elif listType == 'ordered':
+ lnode = dest.appendElement('orderedlist')
+
+ if lnode != None:
+ for child in src.getChildNodes():
+ self.__walkXHP(child, lnode)
+ else:
+ dest.appendElement('warning').appendContent('unknown list type: ' + listType)
+
+ elif src.name == 'listitem':
+ # This one needs no translation.
+ li = dest.appendElement('listitem')
+ for child in src.getChildNodes():
+ self.__walkXHP(child, li)
+
elif src.name == 'link':
for child in src.getChildNodes():
self.__walkXHP(child, dest)