Changeset 4595 for exist


Ignore:
Timestamp:
11/12/08 11:22:05 (11 years ago)
Author:
cbyrom
Message:

Fix search xquery -adding namespace + fix author check.

Location:
exist/trunk/python/ndgUtils
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/python/ndgUtils/eXistInterface.py

    r4588 r4595  
    8989        xq='''declare default element namespace 'http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/'; \ 
    9090            for $DE in collection()/DIF[Entry_ID='%s'] return $DE'''%entryID 
    91         xquery='''for $DE in collection('/db/testdif1')/DIF[Entry_ID='%s'] return $DE'''%entryID 
    92         id,summary=self.executeQuery(xq)#xquery) 
     91        id,summary=self.executeQuery(xq) 
    9392        if summary['hits']==1: 
    9493            r=self.retrieve(id,0,{}) 
     
    163162        xquery = "declare namespace moles='http://ndg.nerc.ac.uk/schema/moles2beta';\n" + \ 
    164163            "declare namespace atom='http://www.w3.org/2005/Atom';\n" + \ 
    165             "for $DE in collection('/db/atoms')/entry[" 
     164            "for $DE in collection('/db/atoms')/atom:entry[" 
    166165 
    167166        # only add the required search clauses - NB, these increase the search time 
  • exist/trunk/python/ndgUtils/models/Atom.py

    r4592 r4595  
    571571        self._linksToXML(root) 
    572572 
    573         if self.author.hasValue(): 
     573        if self.author and self.author.hasValue(): 
    574574            root.append(self.author.toXML()) 
    575575             
Note: See TracChangeset for help on using the changeset viewer.