summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-01-17 13:22:56 -0500
committerKohei Yoshida <kyoshida@novell.com>2010-01-17 13:22:56 -0500
commit1b6adfc947d55d0b3f6c31889f91a0af5007ce1b (patch)
tree14bb43ebad7e6e882a87f2ff1f9b7fa650c144b7
parent27132676fa298e4d89386d97f1a5c61365ca5357 (diff)
Pick up and store filename content from xhp sources.
-rw-r--r--source/docbook.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/source/docbook.py b/source/docbook.py
index c73e2bf..71afb3a 100644
--- a/source/docbook.py
+++ b/source/docbook.py
@@ -129,6 +129,7 @@ class DocBookConverter:
self.root = node.Root()
self.exthelps = {} # texts for extended helps.
self.headingParent = None
+ self.__currentFileName = None
def convert (self):
book = self.root.appendElement('book')
@@ -159,9 +160,25 @@ class DocBookConverter:
else:
sect.appendElement('warning').appendContent('get content from ' + src.getAttr('path'))
+ def __getFileName (self, xhproot):
+ self.__currentFileName = None
+ helpdoc = xhproot.firstChild()
+ if helpdoc == None:
+ return
+ xhpmeta = helpdoc.firstChildByName('meta')
+ topic = xhpmeta.firstChildByName('topic')
+ if topic == None:
+ return
+ filename = topic.firstChildByName('filename')
+ if filename == None:
+ return
+ self.__currentFileName = filename.getContent()
+
def __getContentFromXHP (self, xhppath, dest):
xhproot = self.xhproots[xhppath]
- xhpbody = xhproot.firstChild().firstChildByName('body')
+ helpdoc = xhproot.firstChild()
+ self.__getFileName(xhproot)
+ xhpbody = helpdoc.firstChildByName('body')
# parent element for the xhp 'heading' paragraphs which should start a
# new sub-section when converting to docbook.
self.headingParent = None