comparison MpdlXmlTextServer.py @ 291:3b54df7ca88e

*** empty log message ***
author abukhman
date Thu, 14 Oct 2010 14:08:43 +0200
parents 21e87569f711
children d97ab809de6f
comparison
equal deleted inserted replaced
290:21e87569f711 291:3b54df7ca88e
145 xpath='//place' 145 xpath='//place'
146 docpath = docinfo['textURLPath'] 146 docpath = docinfo['textURLPath']
147 url = docinfo['url'] 147 url = docinfo['url']
148 selfurl = self.absolute_url() 148 selfurl = self.absolute_url()
149 pn = pageinfo['current'] 149 pn = pageinfo['current']
150 hrefList=[]
150 151
151 text=self.getServerData("xpath.xql", "document=%s&xpath=%s&pn=%s"%(docinfo['textURLPath'],xpath,pn)) 152 text=self.getServerData("xpath.xql", "document=%s&xpath=%s&pn=%s"%(docinfo['textURLPath'],xpath,pn))
152 dom = Parse(text) 153 dom = Parse(text)
153 result = dom.xpath("//result/resultPage/place") 154 result = dom.xpath("//result/resultPage/place")
154 for l in result: 155 for l in result:
155 hrefNode= l.getAttributeNodeNS(None, u"id") 156 hrefNode= l.getAttributeNodeNS(None, u"id")
156 href= hrefNode.nodeValue 157 href= hrefNode.nodeValue
157 158 hrefList.add(href)
159 #href=href.href
158 #href = ",".join(href) 160 #href = ",".join(href)
159 logging.debug("getGisPlaces :%s"%(href)) 161 logging.debug("getGisPlaces :%s"%(hrefList))
160 162
161 #return ";".join(["%s=%s" % (href, href) for href, href in params.items()]) 163 #return ";".join(["%s=%s" % (href, href) for href, href in params.items()])
162 logging.debug("getGisPlaces :%s"%(href)) 164 #logging.debug("getGisPlaces :%s"%(href))
163 #if href.startswith('id='): 165 #if href.startswith('id='):
164 #hrefNode.nodeValue = href.replace('id=',"?") 166 #hrefNode.nodeValue = href.replace('id=',"?")
165 #logging.debug("documentViewer getGisPlaces (characterNormalization) hrefNode.nodeValue:%s"%(hrefNode.nodeValue)) 167 #logging.debug("documentViewer getGisPlaces (characterNormalization) hrefNode.nodeValue:%s"%(hrefNode.nodeValue))
166 #logging.debug("getGisPlaces :%s"%(href)) 168 #logging.debug("getGisPlaces :%s"%(href))
167 return href 169 return hrefList
168 #return "no text here" 170 #return "no text here"
169 171
170 def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""): 172 def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""):
171 """returns single page from fulltext""" 173 """returns single page from fulltext"""
172 docpath = docinfo['textURLPath'] 174 docpath = docinfo['textURLPath']