geonetwork / geonetwork/core-geonetwork

xml not having namespace name in schemalocation is allowed if gmd is default namespace?

Open
#4,367 6 comments 0 reactions 0 assignees View on GitHub
question stale
Dominant language
Java
Stars
521
Forks
514
Avg merge
6d 13h
Merged PRs (30d)
19

Description

This is a bit guessing here, because i'm not fully aware of the specs, I noticed the attached record invalidates in geonetwork because it seems due to improperly unsetting gmd as the default namespace

Record has this as a header (gmd is default namespace)

```xml

```

Some xml parsers seem to allow to omit the namespace hint in schemalocation if gmd is the default namespace.

At import GeoNetwork unsets gmd as the default namespace but neglects to add the namespace hint to the schemalocation, then gn throws an error at validation:

```
SchemaLocation: schemaLocation value = 'http://schemas.opengis.net/iso/19139/20060504/gmd/gmd.xsd' must have even number of URI's. (Element: gmd:MD_Metadata with parent element: Unknown)
```

[Geomagazijn.GEO.NAT_NNN_NATUURNETWERKNL.xml.zip](https://github.com/geonetwork/core-geonetwork/files/4063941/Geomagazijn.GEO.NAT_NNN_NATUURNETWERKNL.xml.zip)

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.