Ignore:
Timestamp:
15/09/08 10:41:44 (12 years ago)
Author:
cbyrom
Message:

Extend xmlHandler to allow specification of different namespaces when
using the _distrbutens method to decorate xpath expressions with namespaces
+ add logging + add namespace info to ndgObject - for NSs used in the
various doc types + fix bug in ndgSearch to check response Hits properly.

File:
1 edited

Legend:

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

    r4187 r4196  
    66                (1) a downloadable xml representation from a repository, 
    77                (2) a printable xml representation ''' 
    8      
     8 
    99    # The various different document types: 
    1010    MOLES_DOC_TYPE = 'NDG-B0' 
     
    1919    ATOM_DOC_TYPE = 'ATOM' 
    2020    ATOM_BACKUP_DOC_TYPE = 'ATOM-BACKUP' 
     21 
     22        # various namespaces used in the docs 
     23    ATOM_NS = 'http://www.w3.org/2005/Atom' 
     24    MOLES_NS = 'http://ndg.nerc.ac.uk/schema/moles2alpha' 
     25    GEOSS_NS = 'http://www.georss.org/georss' 
     26    GML_NS = 'http://www.opengis.net/gml' 
    2127         
    2228    # Group the doc types according to the source they should be retrieved from 
     
    2632                      NUMSIM_DOC_TYPE, ATOM_DOC_TYPE, \ 
    2733                      ATOM_BACKUP_DOC_TYPE] 
    28  
     34     
    2935    def __init__(self,uri,config=None): 
    3036        ''' Parse the uri and prepare for obtaining the actual content''' 
     
    145151        #now, we'll build a stub-B url as well, in case that comes in handy  
    146152        if self.schema!='NumSim' and self.gettable<>-1: 
    147             self.BURL=discoveryBASE.replace(self.schema,'NDG-B1') 
     153            if self.schema: 
     154                self.BURL=discoveryBASE.replace(self.schema,'NDG-B1') 
    148155            if server: 
    149156                self.BURL=self.BURL.replace(server,servicehost) 
Note: See TracChangeset for help on using the changeset viewer.