version 1.80, 2010/10/11 15:06:33
|
version 1.88, 2010/10/13 15:06:03
|
Line 140 class MpdlXmlTextServer(SimpleItem):
|
Line 140 class MpdlXmlTextServer(SimpleItem):
|
docinfo['numPages']=int(getTextFromNode(result[0])) |
docinfo['numPages']=int(getTextFromNode(result[0])) |
return docinfo |
return docinfo |
|
|
def getGisPlases(self, docinfo): |
def getGisPlaces(self, docinfo): |
""" Show all Gis Places of whole Page""" |
""" Show all Gis Places of whole Page""" |
xpath='//place' |
#xpath='//place' |
text=self.getServerData("xpath.xql", "document=%s&xpath=%s&pn=%s"%(docinfo['textURLPath'], xpath,pn)) |
text=self.getServerData("xpath.xql", "document=%s&xpath='//place'%s&pn=%s"%(docinfo['textURLPath'],pn)) |
|
logging.debug("documentViewer getGisPlaces (text) text:%s"%(text)) |
pagedom = Parse(text) |
pagedom = Parse(text) |
result =pagedom.xpath("//result/resultPage/") |
result =pagedom.xpath("//result/resultPage/*") |
for l in result: |
for l in result: |
hrefNode= l.getAttributeNodeNS(None, u"place") |
hrefNode= l.getAttributeNodeNS(None, u"id") |
|
logging.debug("documentViewer getGisPlaces (characterNormalization) l:%s"%(l)) |
if hrefNode: |
if hrefNode: |
href= hrefNode.nodeValue |
href= hrefNode.nodeValue |
if href.startswith('id='): |
if href.startswith('id='): |
hrefNode.nodeValue = href.replace('id=',"?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&pn=%sid="%(url,viewMode,tocMode,tocPN,pn)) |
hrefNode.nodeValue = href.replace('id=',"?") |
logging.debug("YYYY href%s"%href) |
|
logging.debug("YYYY serializeNode(pagenode)%s"%serializeNode(pagenode)) |
|
logging.debug("YYYY hrefNode.nodeValue%s"%hrefNode.nodeValue) |
|
logging.debug("YYYY serializeNode(pagenode)%s"%serializeNode(pagenode)) |
|
return serializeNode(pagenode) |
return serializeNode(pagenode) |
|
|
def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""): |
def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""): |