opendatatrentino / opendata-harvester

Harvester for OpenData
BSD 2-Clause "Simplified" License
3 stars 0 forks source link

Fix geocatalogo / catasto resource url #14

Closed rshk closed 9 years ago

rshk commented 10 years ago

For the Catasto (at least) the url should be taken from the linked XML.

Links are in:

/gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource/gmd:linkage/gmd:URL/text()

There is also a field containing "protocol":

for res in xml.xpath('/gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource', namespaces=xml.nsmap):
    print(res.xpath('gmd:protocol/gco:CharacterString/text()', namespaces=xml.nsmap), res.xpath('gmd:linkage/gmd:URL/text()', namespaces=xml.nsmap))