Skip to content

Commit

Permalink
safeguard JSON links in ISO mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Sep 16, 2023
1 parent 1edf39e commit 2e4f328
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions pycsw/plugins/profiles/apiso/apiso.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,13 +688,19 @@ 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']
if 'name' in 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']

desc = etree.SubElement(online2, util.nspath_eval('gmd:description', self.namespaces))
etree.SubElement(desc, util.nspath_eval('gco:CharacterString', self.namespaces)).text = link['description']
if 'description' in link:
desc = etree.SubElement(online2, util.nspath_eval('gmd:description', self.namespaces))
etree.SubElement(desc, util.nspath_eval('gco:CharacterString', self.namespaces)).text = link['description']

if 'function' in link:
desc = etree.SubElement(online2, util.nspath_eval('gmd:function', self.namespaces))
etree.SubElement(desc, util.nspath_eval('gco:CharacterString', self.namespaces)).text = link['function']

return node

Expand Down

0 comments on commit 2e4f328

Please sign in to comment.