summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2009-12-25 00:08:32 -0500
committerKohei Yoshida <kyoshida@novell.com>2009-12-25 00:08:32 -0500
commit5b8e0bb87b53491f43655317c13852a742b1c612 (patch)
treecb697ecf4c800dfea533f105dfabfbc930010993
parent40309880fb1004b9b5786c1f02c5a1efb2805864 (diff)
Handle <embedvar> & several bug fixes.
-rw-r--r--source/docbook.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/docbook.py b/source/docbook.py
index cf910ad..51ccb13 100644
--- a/source/docbook.py
+++ b/source/docbook.py
@@ -157,7 +157,7 @@ class DocBookConverter:
if self.xhproots.has_key(xhppath):
self.__getContentFromXHP(xhppath, sect)
else:
- sect.appendElement('para').appendContent('get content from ' + src.getAttr('path'))
+ sect.appendElement('warning').appendContent('get content from ' + src.getAttr('path'))
def __getContentFromXHP (self, xhppath, dest):
xhproot = self.xhproots[xhppath]
@@ -191,20 +191,27 @@ class DocBookConverter:
elif DocBookConverter.elemIgnored.has_key(src.name):
# we can ignore these elements.
pass
- elif src.name == 'embed':
+ elif src.name == 'embed' or src.name == 'embedvar':
# embed takes its content from another xhp file.
href = src.getAttr('href')
embed = self.__getEmbedNode(href)
+ paraEmbed = (src.name == 'embed')
if embed == None:
dest.appendElement('warning').appendContent('take embedded content from ' + href)
- else:
+ elif paraEmbed:
para = dest.appendElement('para')
- dest = self.__walkXHP(embed, para)
+ self.__walkXHP(embed, para)
+ else:
+ self.__walkXHP(embed, dest)
elif src.name == 'switchinline':
# For now, always select the <defaultinline> child element.
- content = src.firstChildByName('defaultinline').getContent()
- dest.appendContent(content)
+ definline = src.firstChildByName('defaultinline')
+ if definline == None:
+ dest.appendContent('???????')
+ else:
+ content = src.firstChildByName('defaultinline').getContent()
+ dest.appendContent(content)
elif src.name == 'item':
# an <item> element has a 'type' attribute that specifies how this