Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GS to GN] Generated MDs via "CSW-T Insert" / gco XML prefix issue #40

Open
pmauduit opened this issue May 22, 2017 · 0 comments
Open

Comments

@pmauduit
Copy link
Member

pmauduit commented May 22, 2017

When creating MD via CSW-T, even if the root element for each MD contains a reference to the gco prefix, this one is discarded from the root element, and repeated on each element which needs it, e.g.:

  <gmd:contact>
    <gmd:CI_ResponsibleParty>
      <gmd:individualName>
        <gco:CharacterString xmlns:gco="http://www.isotc211.org/2005/gco">Maël REBOUX - Service Information Géographique</gco:CharacterString>
      </gmd:individualName>
[...]

Yet perfeclty valid XML, this is not very human-readable (well, if we can consider human-readablility of iso19139 metadatas ...). One solution will be to force gco to be defined on each root element of inserted metadatas, here is a unit test which validates this approach:

    @Test
    public void testXmlSerializationGcoEachElem() throws IOException, JDOMException {
        Element elem = Xml.loadStream(this.getClass().getResourceAsStream("mdgco-eachelem.xml"));
        elem.addNamespaceDeclaration(Namespaces.GCO);
        assertTrue(Xml.getString(elem).contains("<gmd:MD_Metadata xmlns:gmd=\"http://www.isotc211.org/2005/gmd\" xmlns:geonet=\"http://www.fao.org/geonetwork\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:gco=\"http://www.isotc211.org/2005/gco\" xsi:schemaLocation=\"http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd http://www.isotc211.org/2005/gmx http://www.isotc211.org/2005/gmx/gmx.xsd http://www.isotc211.org/2005/srv http://schemas.opengis.net/iso/19139/20060504/srv/srv.xsd\">"));
    }

To be placed somewhere in the CSW-T code and the Metadata's dataManager GN logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant