comparison MpdlXmlTextServer.py @ 293:740f57b98460

*** empty log message ***
author abukhman
date Thu, 14 Oct 2010 14:21:41 +0200
parents d97ab809de6f
children 38ee730716c8
comparison
equal deleted inserted replaced
292:d97ab809de6f 293:740f57b98460
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 hrefList=[]
151 151
152 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))
153 dom = Parse(text) 153 dom = Parse(text)
154 result = dom.xpath("//result/resultPage/place") 154 result = dom.xpath("//result/resultPage/place")
155 for l in result: 155 for l in result:
156 hrefNode= l.getAttributeNodeNS(None, u"id") 156 hrefNode= l.getAttributeNodeNS(None, u"id")
157 href= hrefNode.nodeValue 157 href= hrefNode.nodeValue
158 hrefList.append(href) 158 hrefList.append(href)
159 #href=href.href 159 hoh=hrefList.split(u'')
160 #href = ",".join(href)
161 logging.debug("getGisPlaces :%s"%(hrefList)) 160 logging.debug("getGisPlaces :%s"%(hrefList))
162 161 logging.debug("getGisPlaces :%s"%(hoh))
163 #return ";".join(["%s=%s" % (href, href) for href, href in params.items()]) 162
164 #logging.debug("getGisPlaces :%s"%(href))
165 #if href.startswith('id='):
166 #hrefNode.nodeValue = href.replace('id=',"?")
167 #logging.debug("documentViewer getGisPlaces (characterNormalization) hrefNode.nodeValue:%s"%(hrefNode.nodeValue))
168 #logging.debug("getGisPlaces :%s"%(href))
169 return hrefList 163 return hrefList
170 #return "no text here"
171 164
172 def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""): 165 def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""):
173 """returns single page from fulltext""" 166 """returns single page from fulltext"""
174 docpath = docinfo['textURLPath'] 167 docpath = docinfo['textURLPath']
175 path = docinfo['textURLPath'] 168 path = docinfo['textURLPath']