From a8b0a2c0c5dd772838b53611ac4ff167ef7bc43f Mon Sep 17 00:00:00 2001 From: Paul van Genuchten Date: Fri, 4 Oct 2024 21:24:57 +0200 Subject: [PATCH] adds support for gmx:anchor in gmd:identifier, fixes #946 --- owslib/iso.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/owslib/iso.py b/owslib/iso.py index ae486b36..c30a4c88 100644 --- a/owslib/iso.py +++ b/owslib/iso.py @@ -407,15 +407,26 @@ def __init__(self, md=None, identtype=None): self.uricode = [] _values = md.findall(util.nspath_eval( - 'gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:code/gco:CharacterString', + 'gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString', namespaces)) _values += md.findall(util.nspath_eval( - 'gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString', + 'gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:code/gco:CharacterString', namespaces)) for i in _values: val = util.testXMLValue(i) if val is not None: self.uricode.append(val) + + _values = md.findall(util.nspath_eval( + 'gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/gmx:Anchor', + namespaces)) + _values += md.findall(util.nspath_eval( + 'gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:code/gmx:Anchor', + namespaces)) + for i in _values: + val = util.testXMLValue(i.attrib.get('xlink:href'), True) + if val is not None: + self.uricode.append(val) self.uricodespace = [] for i in md.findall(util.nspath_eval(