From 522c5f884ef8e6fc340b1fc928682d9e0cb95155 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Sat, 16 Sep 2023 08:13:23 -0400 Subject: [PATCH] safeguard JSON links in ISO mode (#896) --- pycsw/plugins/profiles/apiso/apiso.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pycsw/plugins/profiles/apiso/apiso.py b/pycsw/plugins/profiles/apiso/apiso.py index 97fade44a..6334cefd1 100644 --- a/pycsw/plugins/profiles/apiso/apiso.py +++ b/pycsw/plugins/profiles/apiso/apiso.py @@ -688,13 +688,13 @@ def write_record(self, result, esn, outputschema, queryables, caps=None): etree.SubElement(linkage, util.nspath_eval('gmd:URL', self.namespaces)).text = link['url'] protocol = etree.SubElement(online2, util.nspath_eval('gmd:protocol', self.namespaces)) - etree.SubElement(protocol, util.nspath_eval('gco:CharacterString', self.namespaces)).text = link['protocol'] + etree.SubElement(protocol, util.nspath_eval('gco:CharacterString', self.namespaces)).text = link.get('protocol', 'WWW:LINK') name = etree.SubElement(online2, util.nspath_eval('gmd:name', self.namespaces)) - etree.SubElement(name, util.nspath_eval('gco:CharacterString', self.namespaces)).text = link['name'] + etree.SubElement(name, util.nspath_eval('gco:CharacterString', self.namespaces)).text = link.get('name') desc = etree.SubElement(online2, util.nspath_eval('gmd:description', self.namespaces)) - etree.SubElement(desc, util.nspath_eval('gco:CharacterString', self.namespaces)).text = link['description'] + etree.SubElement(desc, util.nspath_eval('gco:CharacterString', self.namespaces)).text = link.get('description') return node