GSA / GSA/data.gov

default xml namespaces are used for xml raw sources

Open
#6,328 0 comments 0 reactions 1 assignee Claimed by @rshewitt View on GitHub
bug
Dominant language
Python
Stars
1.1k
Forks
200
Avg merge
4h 56m
Merged PRs (30d)
5

Description

this [xml doc](https://catalog.data.gov/harvest_record/2e30d6b1-4763-4569-a04f-e26bba3ea5b0/raw) has the wrong namespaces (e.g. `ns0` instead of `gmi`). [this](https://data.noaa.gov/waf/NOAA/nos/ngs/iso/xml/39738.xml) is what it should look like.

Image

Image

## How to reproduce
go to the first link and see the wrong namespaces used

## Expected behavior
the correct namespaces are used

## Actual behavior
the default/wrong namespaces are used.

## Sketch
configure namespaces in the element tree for the `.../raw` route in catalog. here's the [code line](https://github.com/GSA/datagov-catalog/blob/6b9423fc9d4e11718704d506a22304707c558eba/app/routes.py#L644).

you'd do it like below. here's the namespace registration in [mdtranslator](https://github.com/GSA/mdTranslator/blob/124586c00e2b3bcc7462fe3709e4e571229fd7f7/lib/adiwg/mdtranslator/internal/module_utils.rb#L87-L98)
```python
ET.register_namespace("dcat", "http://www.w3.org/ns/dcat#")
ET.register_namespace("dct", "http://purl.org/dc/terms/")
ET.register_namespace("foaf", "http://xmlns.com/foaf/0.1/")
ET.register_namespace("vcard", "http://www.w3.org/2006/vcard/ns#")
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.