diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2009-12-24 01:25:07 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2009-12-24 01:25:07 -0500 |
commit | 51bc548ec8c73dd22bfa020e3173da287fe5257a (patch) | |
tree | 3ba96e85dcafeb1f1df51f5642709a62b16b7d56 | |
parent | d993070349dba814950288dbc6bc57fd1d7eb5b9 (diff) |
Added some very basic table element handler.
-rw-r--r-- | source/docbook.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/docbook.py b/source/docbook.py index 3ecee48..a9edad6 100644 --- a/source/docbook.py +++ b/source/docbook.py @@ -250,6 +250,21 @@ class DocBookConverter: for child in src.getChildNodes(): dest = self.__walkXHP(child, dest) + elif src.name == 'table': + tab = dest.appendElement('table').appendElement('tgroup').appendElement('tbody') + for child in src.getChildNodes(): + self.__walkXHP(child, tab) + + elif src.name == 'tablerow': + tab = dest.appendElement('row') + for child in src.getChildNodes(): + self.__walkXHP(child, tab) + + elif src.name == 'tablecell': + tab = dest.appendElement('entry') + for child in src.getChildNodes(): + self.__walkXHP(child, tab) + else: # unhandled element. My work is done when these elements go away. dest.appendElement('warning').appendContent("unhandled element '%s'"%src.name) @@ -260,3 +275,4 @@ class DocBookConverter: def prettyPrint (self, fd): node.prettyPrint(fd, self.root) + |