summaryrefslogtreecommitdiff
path: root/source/docbook.py
diff options
context:
space:
mode:
Diffstat (limited to 'source/docbook.py')
-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