#NEWLINE# def __init__( self , md = None ) : #NEWLINE# #INDENT# if ( md is None ) : #NEWLINE# #INDENT# self . xml = None #NEWLINE# self . identifier = None #NEWLINE# self . parentidentifier = None #NEWLINE# self . language = None #NEWLINE# self . dataseturi = None #NEWLINE# self . languagecode = None #NEWLINE# self . datestamp = None #NEWLINE# self . charset = None #NEWLINE# self . hierarchy = None #NEWLINE# self . contact = [ ] #NEWLINE# self . datetimestamp = None #NEWLINE# self . stdname = None #NEWLINE# self . stdver = None #NEWLINE# self . referencesystem = None #NEWLINE# self . identification = None #NEWLINE# self . serviceidentification = None #NEWLINE# self . identificationinfo = [ ] #NEWLINE# self . distribution = None #NEWLINE# self . dataquality = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( md , 'getroot' ) : #NEWLINE# #INDENT# self . xml = etree . tostring ( md . getroot ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . xml = etree . tostring ( md ) #NEWLINE# #UNINDENT# val = md . find ( util . nspath_eval ( 'gmd:fileIdentifier/gco:CharacterString' , namespaces ) ) #NEWLINE# self . identifier = util . testXMLValue ( val ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:parentIdentifier/gco:CharacterString' , namespaces ) ) #NEWLINE# self . parentidentifier = util . testXMLValue ( val ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:language/gco:CharacterString' , namespaces ) ) #NEWLINE# self . language = util . testXMLValue ( val ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:dataSetURI/gco:CharacterString' , namespaces ) ) #NEWLINE# self . dataseturi = util . testXMLValue ( val ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:language/gmd:LanguageCode' , namespaces ) ) #NEWLINE# self . languagecode = util . testXMLAttribute ( val , 'codeListValue' ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:dateStamp/gco:Date' , namespaces ) ) #NEWLINE# self . datestamp = util . testXMLValue ( val ) #NEWLINE# if ( not self . datestamp ) : #NEWLINE# #INDENT# val = md . find ( util . nspath_eval ( 'gmd:dateStamp/gco:DateTime' , namespaces ) ) #NEWLINE# self . datestamp = util . testXMLValue ( val ) #NEWLINE# #UNINDENT# self . charset = _testCodeListValue ( md . find ( util . nspath_eval ( 'gmd:characterSet/gmd:MD_CharacterSetCode' , namespaces ) ) ) #NEWLINE# self . hierarchy = _testCodeListValue ( md . find ( util . nspath_eval ( 'gmd:hierarchyLevel/gmd:MD_ScopeCode' , namespaces ) ) ) #NEWLINE# self . contact = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:contact/gmd:CI_ResponsibleParty' , namespaces ) ) : #NEWLINE# #INDENT# o = CI_ResponsibleParty ( i ) #NEWLINE# self . contact . append ( o ) #NEWLINE# #UNINDENT# val = md . find ( util . nspath_eval ( 'gmd:dateStamp/gco:DateTime' , namespaces ) ) #NEWLINE# self . datetimestamp = util . testXMLValue ( val ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:metadataStandardName/gco:CharacterString' , namespaces ) ) #NEWLINE# self . stdname = util . testXMLValue ( val ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:metadataStandardVersion/gco:CharacterString' , namespaces ) ) #NEWLINE# self . stdver = util . testXMLValue ( val ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:referenceSystemInfo/gmd:MD_ReferenceSystem' , namespaces ) ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . referencesystem = MD_ReferenceSystem ( val ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . referencesystem = None #NEWLINE# #UNINDENT# warnings . warn ( 'the .identification and .serviceidentification properties will merge into .identification being a list of properties.  This is currently implemented in .identificationinfo.  Please see https://github.com/geopython/OWSLib/issues/38 for more information' , FutureWarning ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:identificationInfo/gmd:MD_DataIdentification' , namespaces ) ) #NEWLINE# val2 = md . find ( util . nspath_eval ( 'gmd:identificationInfo/srv:SV_ServiceIdentification' , namespaces ) ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . identification = MD_DataIdentification ( val , 'dataset' ) #NEWLINE# self . serviceidentification = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( val2 is not None ) : #NEWLINE# #INDENT# self . identification = MD_DataIdentification ( val2 , 'service' ) #NEWLINE# self . serviceidentification = SV_ServiceIdentification ( val2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . identification = None #NEWLINE# self . serviceidentification = None #NEWLINE# #UNINDENT# #UNINDENT# self . identificationinfo = [ ] #NEWLINE# for idinfo in md . findall ( util . nspath_eval ( 'gmd:identificationInfo' , namespaces ) ) : #NEWLINE# #INDENT# if ( len ( idinfo ) > 0 ) : #NEWLINE# #INDENT# val = list ( idinfo ) [ 0 ] #NEWLINE# tagval = util . xmltag_split ( val . tag ) #NEWLINE# if ( tagval == 'MD_DataIdentification' ) : #NEWLINE# #INDENT# self . identificationinfo . append ( MD_DataIdentification ( val , 'dataset' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( tagval == 'MD_ServiceIdentification' ) : #NEWLINE# #INDENT# self . identificationinfo . append ( MD_DataIdentification ( val , 'service' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( tagval == 'SV_ServiceIdentification' ) : #NEWLINE# #INDENT# self . identificationinfo . append ( SV_ServiceIdentification ( val ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# val = md . find ( util . nspath_eval ( 'gmd:distributionInfo/gmd:MD_Distribution' , namespaces ) ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . distribution = MD_Distribution ( val ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . distribution = None #NEWLINE# #UNINDENT# val = md . find ( util . nspath_eval ( 'gmd:dataQualityInfo/gmd:DQ_DataQuality' , namespaces ) ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . dataquality = DQ_DataQuality ( val ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . dataquality = None