Changeset 205:1fc7d73ce7ce in documentViewer for MpdlXmlTextServer.py


Ignore:
Timestamp:
Oct 5, 2010, 2:58:34 PM (14 years ago)
Author:
abukhman
Branch:
default
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MpdlXmlTextServer.py

    r204 r205  
    131131    def getNumTextPages (self, docinfo):
    132132        """get list of pages from fulltext (texts without images) and put in docinfo"""
    133        # if 'numPages' in docinfo:
     133        if 'numPages' in docinfo:
    134134            # allredy there
    135         #    return docinfo
    136        # xpath ='/count(//pb)'
    137        # text=self.getServerData("xpath.xql", "document=%s&xpath=%s"%(docinfo['textURLPath'], xpath))
    138        # logging.debug("documentViewer (text) text: %s"%(text))
    139         #docinfo['numPages']=text('resultPage')
    140        # dom = Parse(text)
    141        
    142        # result= dom.xpath("//result/resultPage")
    143        # docinfo['numPages']=int(getTextFromNode(result[0]))
    144         #logging.debug("documentViewer (characterNormalization) docinfo['numPages']: %s"%(docinfo['numPages']))
     135            return docinfo
     136        xpath ='/count(//pb)'
     137        text=self.getServerData("xpath.xql", "document=%s&xpath=%s"%(docinfo['textURLPath'], xpath))
     138        docinfo['numPages']=text('resultPage')
     139        dom = Parse(text)
     140        result= dom.xpath("//result/resultPage")
     141        docinfo['numPages']=int(getTextFromNode(result[0]))
    145142        return docinfo
    146143       
Note: See TracChangeset for help on using the changeset viewer.