comparison MpdlXmlTextServer.py @ 245:437d697a40e5

*** empty log message ***
author abukhman
date Mon, 11 Oct 2010 17:45:51 +0200
parents 7f089a0cb189
children 6a43ff50eb9a
comparison
equal deleted inserted replaced
244:7f089a0cb189 245:437d697a40e5
143 def getGisPlases(self, docinfo): 143 def getGisPlases(self, docinfo):
144 """ Show all Gis Places of whole Page""" 144 """ Show all Gis Places of whole Page"""
145 xpath='//place' 145 xpath='//place'
146 text=self.getServerData("xpath.xql", "document=%s&xpath=%s&pn=%s"%(docinfo['textURLPath'], xpath,pn)) 146 text=self.getServerData("xpath.xql", "document=%s&xpath=%s&pn=%s"%(docinfo['textURLPath'], xpath,pn))
147 pagedom = Parse(text) 147 pagedom = Parse(text)
148 result =pagedom.xpath("//result/resultPage/") 148 result =pagedom.xpath("//result/resultPage/place")
149 for l in result: 149 for l in result:
150 hrefNode= l.getAttributeNodeNS(None, u"place") 150 hrefNode= l.getAttributeNodeNS(None, u"id")
151 logging.debug("documentViewer (characterNormalization) l: %s"%(l))
151 if hrefNode: 152 if hrefNode:
152 href= hrefNode.nodeValue 153 href= hrefNode.nodeValue
153 if href.startswith('id='): 154 if href.startswith('id='):
154 hrefNode.nodeValue = href.replace('id=',"?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&pn=%sid="%(url,viewMode,tocMode,tocPN,pn)) 155 hrefNode.nodeValue = href.replace('id=',"?")
155 logging.debug("YYYY href%s"%href) 156
156 logging.debug("YYYY serializeNode(pagenode)%s"%serializeNode(pagenode))
157 logging.debug("YYYY hrefNode.nodeValue%s"%hrefNode.nodeValue)
158 logging.debug("YYYY serializeNode(pagenode)%s"%serializeNode(pagenode))
159 return serializeNode(pagenode) 157 return serializeNode(pagenode)
160 158
161 def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""): 159 def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""):
162 """returns single page from fulltext""" 160 """returns single page from fulltext"""
163 docpath = docinfo['textURLPath'] 161 docpath = docinfo['textURLPath']