changeset 324:9d69b218f74c

*** empty log message ***
author abukhman
date Fri, 15 Oct 2010 16:09:01 +0200
parents 1519853d5efb
children c7e38112c23a
files MpdlXmlTextServer.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Fri Oct 15 16:06:50 2010 +0200
+++ b/MpdlXmlTextServer.py	Fri Oct 15 16:09:01 2010 +0200
@@ -184,15 +184,16 @@
         #url = docinfo['url']
         selfurl = self.absolute_url()
         pn =pageinfo['current']
-        pagedivs=""
+        pagedivs
         viewMode=  pageinfo['viewMode']
         text = self.getServerData("page-fragment.xql","document=%s&mode=%s&pn=%s"%(docinfo['textURLPath'], 'text',  pn))
         dom =Parse(text)
         pagedivs = dom.xpath("//div[@class='pageNumberOrig']")
-        logging.debug("getOrigPages :%s"%(pagedivs))
-        original =getTextFromNode(pagedivs)
-        logging.debug("XXXXXXXXXXXgetOrigPagesXXXXXXXX :%s"%(original))
-        return original
+        if len(pagedivs)>0:
+            logging.debug("getOrigPages :%s"%(pagedivs))
+            original =getTextFromNode(pagedivs[0])
+            logging.debug("XXXXXXXXXXXgetOrigPagesXXXXXXXX :%s"%(original))
+            return original
     
     def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""):
         """returns single page from fulltext"""