[GeoNetwork-devel] - Metadata export generates invalid XML Dublin Core file

Dear all,

I would like to ask you why GeoNetwork generates invalid Dublin Core XML file?

I have created a testing record using GN metadata editor - Dublin Core metadata template:

The export to XML is pasted here:

<?xml version="1.0" encoding="UTF-8"?> TESTING MD RECORD TOMAS KLIMENT TEST JRC DESCRIPTION KLIMENT testing resource text/plain eng http://... North 90, South -90, East 180, West -180. Global Fre for testing now tomorrow 2012-09-13T11:39:44 8352f5b4-8be4-4f69-820c-da810f24b988

However it assigns to a schemaLocation attribute simpledc schema, which does not allow elements from dct namespace (dct:created, dct:dateSubmitted etc) thus it causes validation errors:

Element dct:created is not allowed under element .
Reason: The following elements are expected at this location (see below)

Annotations of type 'dc:elementContainer' (see below) This complexType is included as a convenience for schema authors who need to define a root or container element for all of the DC elements. Error location: simpledc / dct:created Details cvc-model-group: Element unexpected by type 'dc:elementContainer' of element . cvc-elt.5.2.1: The element is not valid with respect to the actual type definition 'dc:elementContainer'.

One solution how to resolve this would be to change the schemaLocation and root as follows:

<?xml version="1.0" encoding="UTF-8"?>


dc:titleTESTING MD RECORD</dc:title>
dc:creatorTOMAS KLIMENT</dc:creator>
dc:subjectTEST</dc:subject>
dc:subjectJRC</dc:subject>
dc:descriptionDESCRIPTION</dc:description>
dc:publisherKLIMENT</dc:publisher>
dc:typetesting resource</dc:type>
dc:formattext/plain</dc:format>
dc:languageeng</dc:language>
dc:relationhttp://…</dc:relation>
dc:coverageNorth 90, South -90, East 180, West -180. Global</dc:coverage>
dc:rightsFre for testing</dc:rights>
dct:creatednow</dct:created>
dct:dateSubmittedtomorrow</dct:dateSubmitted>
dct:modified2012-09-13T11:39:44</dct:modified>
dc:identifier8352f5b4-8be4-4f69-820c-da810f24b988</dc:identifier>

To change the Root element from to and schemaLocation to point to qualifieddc.xsd schema.

What would you suggest me? Is this already known issue?

Many thanks in advance for any response,

Best regards,

Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019
Tel: +39 389 4955 954
e-mail: tomas.kliment@anonymised.com
www: http://about.me/klimeto

Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297
e-mail: tomas.kliment@anonymised.com

Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy

External consultant:

Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com

Could you make a trac ticket with this issue? It looks like a good candidate to me. Although I admit I don’t use dublin core so often.

Jesse

On Thu, Sep 13, 2012 at 11:51 AM, Tomas Kliment <tomas.kliment@anonymised.com> wrote:

Dear all,

I would like to ask you why GeoNetwork generates invalid Dublin Core XML file?

I have created a testing record using GN metadata editor - Dublin Core metadata template:

The export to XML is pasted here:

<?xml version="1.0" encoding="UTF-8"?> TESTING MD RECORD TOMAS KLIMENT TEST JRC DESCRIPTION KLIMENT testing resource text/plain eng http://... North 90, South -90, East 180, West -180. Global Fre for testing now tomorrow 2012-09-13T11:39:44 8352f5b4-8be4-4f69-820c-da810f24b988

However it assigns to a schemaLocation attribute simpledc schema, which does not allow elements from dct namespace (dct:created, dct:dateSubmitted etc) thus it causes validation errors:

Element dct:created is not allowed under element .
Reason: The following elements are expected at this location (see below)

Annotations of type 'dc:elementContainer' (see below) This complexType is included as a convenience for schema authors who need to define a root or container element for all of the DC elements. Error location: simpledc / dct:created Details cvc-model-group: Element unexpected by type 'dc:elementContainer' of element . cvc-elt.5.2.1: The element is not valid with respect to the actual type definition 'dc:elementContainer'.

One solution how to resolve this would be to change the schemaLocation and root as follows:

<?xml version="1.0" encoding="UTF-8"?>


dc:titleTESTING MD RECORD</dc:title>
dc:creatorTOMAS KLIMENT</dc:creator>
dc:subjectTEST</dc:subject>
dc:subjectJRC</dc:subject>
dc:descriptionDESCRIPTION</dc:description>
dc:publisherKLIMENT</dc:publisher>
dc:typetesting resource</dc:type>
dc:formattext/plain</dc:format>
dc:languageeng</dc:language>
dc:relationhttp://…</dc:relation>
dc:coverageNorth 90, South -90, East 180, West -180. Global</dc:coverage>
dc:rightsFre for testing</dc:rights>
dct:creatednow</dct:created>
dct:dateSubmittedtomorrow</dct:dateSubmitted>
dct:modified2012-09-13T11:39:44</dct:modified>
dc:identifier8352f5b4-8be4-4f69-820c-da810f24b988</dc:identifier>

To change the Root element from to and schemaLocation to point to qualifieddc.xsd schema.

What would you suggest me? Is this already known issue?

Many thanks in advance for any response,

Best regards,

Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019
Tel: +39 389 4955 954
e-mail: tomas.kliment@anonymised.com
www: http://about.me/klimeto

Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297
e-mail: tomas.kliment@anonymised.com

Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy

External consultant:

Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Hi Jesse,

I have opened a ticket pointing out this issue here: http://trac.osgeo.org/geonetwork/ticket/1047

Meanwhile I tried to change the root and schemaLocation values within the XML and XSLT files related to Dublin Core schema (geonetwork/WEB-INF/data/config/schema_plugins/dublin-core/*.xml/xsl/xsd

I succeeded in changing the schemaLocation URL from changing it in schema-conversion.xml and schema-ident.xml.

However, I could not find the way how to change the root in export.

Any ideas, hints?

Cheers,
Tomas

On 13 September 2012 12:49, Jesse Eichar <jesse.eichar@anonymised.com> wrote:

Could you make a trac ticket with this issue? It looks like a good candidate to me. Although I admit I don’t use dublin core so often.

Jesse

On Thu, Sep 13, 2012 at 11:51 AM, Tomas Kliment <tomas.kliment@anonymised.com31…> wrote:

Dear all,

I would like to ask you why GeoNetwork generates invalid Dublin Core XML file?

I have created a testing record using GN metadata editor - Dublin Core metadata template:

The export to XML is pasted here:

<?xml version="1.0" encoding="UTF-8"?> TESTING MD RECORD TOMAS KLIMENT TEST JRC DESCRIPTION KLIMENT testing resource text/plain eng http://... North 90, South -90, East 180, West -180. Global Fre for testing now tomorrow 2012-09-13T11:39:44 8352f5b4-8be4-4f69-820c-da810f24b988

However it assigns to a schemaLocation attribute simpledc schema, which does not allow elements from dct namespace (dct:created, dct:dateSubmitted etc) thus it causes validation errors:

Element dct:created is not allowed under element .
Reason: The following elements are expected at this location (see below)

Annotations of type 'dc:elementContainer' (see below) This complexType is included as a convenience for schema authors who need to define a root or container element for all of the DC elements. Error location: simpledc / dct:created Details cvc-model-group: Element unexpected by type 'dc:elementContainer' of element . cvc-elt.5.2.1: The element is not valid with respect to the actual type definition 'dc:elementContainer'.

One solution how to resolve this would be to change the schemaLocation and root as follows:

<?xml version="1.0" encoding="UTF-8"?>


dc:titleTESTING MD RECORD</dc:title>
dc:creatorTOMAS KLIMENT</dc:creator>
dc:subjectTEST</dc:subject>
dc:subjectJRC</dc:subject>
dc:descriptionDESCRIPTION</dc:description>
dc:publisherKLIMENT</dc:publisher>
dc:typetesting resource</dc:type>
dc:formattext/plain</dc:format>
dc:languageeng</dc:language>
dc:relationhttp://…</dc:relation>
dc:coverageNorth 90, South -90, East 180, West -180. Global</dc:coverage>
dc:rightsFre for testing</dc:rights>
dct:creatednow</dct:created>
dct:dateSubmittedtomorrow</dct:dateSubmitted>
dct:modified2012-09-13T11:39:44</dct:modified>
dc:identifier8352f5b4-8be4-4f69-820c-da810f24b988</dc:identifier>

To change the Root element from to and schemaLocation to point to qualifieddc.xsd schema.

What would you suggest me? Is this already known issue?

Many thanks in advance for any response,

Best regards,

Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019
Tel: +39 389 4955 954
e-mail: tomas.kliment@anonymised.com
www: http://about.me/klimeto

Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297
e-mail: tomas.kliment@anonymised.com

Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy

External consultant:

Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019
Tel: +39 389 4955 954
e-mail: tomas.kliment@anonymised.com
www: http://about.me/klimeto

Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297
e-mail: tomas.kliment@anonymised.com

Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy

External consultant:

Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com

I think the export xsl files are in : web/src/main/webapp/xsl/conversion/export

Jesse

On Thu, Sep 13, 2012 at 2:36 PM, Tomas Kliment <tomas.kliment@anonymised.com> wrote:

Hi Jesse,

I have opened a ticket pointing out this issue here: http://trac.osgeo.org/geonetwork/ticket/1047

Meanwhile I tried to change the root and schemaLocation values within the XML and XSLT files related to Dublin Core schema (geonetwork/WEB-INF/data/config/schema_plugins/dublin-core/*.xml/xsl/xsd

I succeeded in changing the schemaLocation URL from changing it in schema-conversion.xml and schema-ident.xml.

However, I could not find the way how to change the root in export.

Any ideas, hints?

Cheers,
Tomas

On 13 September 2012 12:49, Jesse Eichar <jesse.eichar@anonymised.com> wrote:

Could you make a trac ticket with this issue? It looks like a good candidate to me. Although I admit I don’t use dublin core so often.

Jesse

On Thu, Sep 13, 2012 at 11:51 AM, Tomas Kliment <tomas.kliment@anonymised.com> wrote:

Dear all,

I would like to ask you why GeoNetwork generates invalid Dublin Core XML file?

I have created a testing record using GN metadata editor - Dublin Core metadata template:

The export to XML is pasted here:

<?xml version="1.0" encoding="UTF-8"?> TESTING MD RECORD TOMAS KLIMENT TEST JRC DESCRIPTION KLIMENT testing resource text/plain eng http://... North 90, South -90, East 180, West -180. Global Fre for testing now tomorrow 2012-09-13T11:39:44 8352f5b4-8be4-4f69-820c-da810f24b988

However it assigns to a schemaLocation attribute simpledc schema, which does not allow elements from dct namespace (dct:created, dct:dateSubmitted etc) thus it causes validation errors:

Element dct:created is not allowed under element .
Reason: The following elements are expected at this location (see below)

Annotations of type 'dc:elementContainer' (see below) This complexType is included as a convenience for schema authors who need to define a root or container element for all of the DC elements. Error location: simpledc / dct:created Details cvc-model-group: Element unexpected by type 'dc:elementContainer' of element . cvc-elt.5.2.1: The element is not valid with respect to the actual type definition 'dc:elementContainer'.

One solution how to resolve this would be to change the schemaLocation and root as follows:

<?xml version="1.0" encoding="UTF-8"?>


dc:titleTESTING MD RECORD</dc:title>
dc:creatorTOMAS KLIMENT</dc:creator>
dc:subjectTEST</dc:subject>
dc:subjectJRC</dc:subject>
dc:descriptionDESCRIPTION</dc:description>
dc:publisherKLIMENT</dc:publisher>
dc:typetesting resource</dc:type>
dc:formattext/plain</dc:format>
dc:languageeng</dc:language>
dc:relationhttp://…</dc:relation>
dc:coverageNorth 90, South -90, East 180, West -180. Global</dc:coverage>
dc:rightsFre for testing</dc:rights>
dct:creatednow</dct:created>
dct:dateSubmittedtomorrow</dct:dateSubmitted>
dct:modified2012-09-13T11:39:44</dct:modified>
dc:identifier8352f5b4-8be4-4f69-820c-da810f24b988</dc:identifier>

To change the Root element from to and schemaLocation to point to qualifieddc.xsd schema.

What would you suggest me? Is this already known issue?

Many thanks in advance for any response,

Best regards,

Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019
Tel: +39 389 4955 954
e-mail: tomas.kliment@anonymised.com
www: http://about.me/klimeto

Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297
e-mail: tomas.kliment@anonymised.com

Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy

External consultant:

Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019
Tel: +39 389 4955 954
e-mail: tomas.kliment@anonymised.com
www: http://about.me/klimeto

Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297
e-mail: tomas.kliment@anonymised.com

Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy

External consultant:

Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com

Yes, I found them, concretely this file: xml_dc.xsl
I changed the root from original simpledc to qualifieddc as follows:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version=“1.0” xmlns:xsl=“http://www.w3.org/1999/XSL/Transform”>

<xsl:template match=“/root”>
<xsl:apply-templates select=“qualifieddc”/>
</xsl:template>

<xsl:template match=“@|node()“>
xsl:copy
<xsl:apply-templates select=”@
|node()[name(self::*)!=‘geonet:info’]”/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

However this makes it not possible to be parsed:

XML Parsing Error: no element found
Location: http://localhost:8080/geonetwork-branch-2012-07-25/srv/eng/xml_dublin-core?uuid=306e2a11-cdda-4e18-b31b-0e314728d19c
Line Number 1, Column 39:<?xml version="1.0" encoding="UTF-8"?>
--------------------------------------^

What I do not understand from where this xsl selects it? I guess that it should be from xsl, which presents element in the editor interface, or not?

Thanks,
Tomas

On 13 September 2012 15:33, Jesse Eichar <jesse.eichar@anonymised.com> wrote:

I think the export xsl files are in : web/src/main/webapp/xsl/conversion/export

Jesse

On Thu, Sep 13, 2012 at 2:36 PM, Tomas Kliment <tomas.kliment@anonymised.com> wrote:

Hi Jesse,

I have opened a ticket pointing out this issue here: http://trac.osgeo.org/geonetwork/ticket/1047

Meanwhile I tried to change the root and schemaLocation values within the XML and XSLT files related to Dublin Core schema (geonetwork/WEB-INF/data/config/schema_plugins/dublin-core/*.xml/xsl/xsd

I succeeded in changing the schemaLocation URL from changing it in schema-conversion.xml and schema-ident.xml.

However, I could not find the way how to change the root in export.

Any ideas, hints?

Cheers,
Tomas

On 13 September 2012 12:49, Jesse Eichar <jesse.eichar@anonymised.com> wrote:

Could you make a trac ticket with this issue? It looks like a good candidate to me. Although I admit I don’t use dublin core so often.

Jesse

On Thu, Sep 13, 2012 at 11:51 AM, Tomas Kliment <tomas.kliment@anonymised.com> wrote:

Dear all,

I would like to ask you why GeoNetwork generates invalid Dublin Core XML file?

I have created a testing record using GN metadata editor - Dublin Core metadata template:

The export to XML is pasted here:

<?xml version="1.0" encoding="UTF-8"?> TESTING MD RECORD TOMAS KLIMENT TEST JRC DESCRIPTION KLIMENT testing resource text/plain eng http://... North 90, South -90, East 180, West -180. Global Fre for testing now tomorrow 2012-09-13T11:39:44 8352f5b4-8be4-4f69-820c-da810f24b988

However it assigns to a schemaLocation attribute simpledc schema, which does not allow elements from dct namespace (dct:created, dct:dateSubmitted etc) thus it causes validation errors:

Element dct:created is not allowed under element .
Reason: The following elements are expected at this location (see below)

Annotations of type 'dc:elementContainer' (see below) This complexType is included as a convenience for schema authors who need to define a root or container element for all of the DC elements. Error location: simpledc / dct:created Details cvc-model-group: Element unexpected by type 'dc:elementContainer' of element . cvc-elt.5.2.1: The element is not valid with respect to the actual type definition 'dc:elementContainer'.

One solution how to resolve this would be to change the schemaLocation and root as follows:

<?xml version="1.0" encoding="UTF-8"?>


dc:titleTESTING MD RECORD</dc:title>
dc:creatorTOMAS KLIMENT</dc:creator>
dc:subjectTEST</dc:subject>
dc:subjectJRC</dc:subject>
dc:descriptionDESCRIPTION</dc:description>
dc:publisherKLIMENT</dc:publisher>
dc:typetesting resource</dc:type>
dc:formattext/plain</dc:format>
dc:languageeng</dc:language>
dc:relationhttp://…</dc:relation>
dc:coverageNorth 90, South -90, East 180, West -180. Global</dc:coverage>
dc:rightsFre for testing</dc:rights>
dct:creatednow</dct:created>
dct:dateSubmittedtomorrow</dct:dateSubmitted>
dct:modified2012-09-13T11:39:44</dct:modified>
dc:identifier8352f5b4-8be4-4f69-820c-da810f24b988</dc:identifier>

To change the Root element from to and schemaLocation to point to qualifieddc.xsd schema.

What would you suggest me? Is this already known issue?

Many thanks in advance for any response,

Best regards,

Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019
Tel: +39 389 4955 954
e-mail: tomas.kliment@anonymised.com
www: http://about.me/klimeto

Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297
e-mail: tomas.kliment@anonymised.com

Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy

External consultant:

Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019
Tel: +39 389 4955 954
e-mail: tomas.kliment@anonymised.com
www: http://about.me/klimeto

Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297
e-mail: tomas.kliment@anonymised.com

Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy

External consultant:

Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com

Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019
Tel: +39 389 4955 954
e-mail: tomas.kliment@anonymised.com
www: http://about.me/klimeto

Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297
e-mail: tomas.kliment@anonymised.com

Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy

External consultant:

Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com

Do you think you could make a fork in your github account and push your changes there so I can clone it and try it out myself?

I would be happy to help tomorrow (friday) if you do that.

Jesse

On Thu, Sep 13, 2012 at 4:47 PM, Tomas Kliment <tomas.kliment@anonymised.com> wrote:

Yes, I found them, concretely this file: xml_dc.xsl
I changed the root from original simpledc to qualifieddc as follows:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version=“1.0” xmlns:xsl=“http://www.w3.org/1999/XSL/Transform”>

<xsl:template match=“/root”>
<xsl:apply-templates select=“qualifieddc”/>
</xsl:template>

<xsl:template match=“@|node()“>
xsl:copy
<xsl:apply-templates select=”@
|node()[name(self::*)!=‘geonet:info’]”/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

However this makes it not possible to be parsed:

XML Parsing Error: no element found
Location: http://localhost:8080/geonetwork-branch-2012-07-25/srv/eng/xml_dublin-core?uuid=306e2a11-cdda-4e18-b31b-0e314728d19c
Line Number 1, Column 39:<?xml version="1.0" encoding="UTF-8"?>
--------------------------------------^

What I do not understand from where this xsl selects it? I guess that it should be from xsl, which presents element in the editor interface, or not?

Thanks,
Tomas

On 13 September 2012 15:33, Jesse Eichar <jesse.eichar@anonymised.com> wrote:

I think the export xsl files are in : web/src/main/webapp/xsl/conversion/export

Jesse

On Thu, Sep 13, 2012 at 2:36 PM, Tomas Kliment <tomas.kliment@anonymised.com> wrote:

Hi Jesse,

I have opened a ticket pointing out this issue here: http://trac.osgeo.org/geonetwork/ticket/1047

Meanwhile I tried to change the root and schemaLocation values within the XML and XSLT files related to Dublin Core schema (geonetwork/WEB-INF/data/config/schema_plugins/dublin-core/*.xml/xsl/xsd

I succeeded in changing the schemaLocation URL from changing it in schema-conversion.xml and schema-ident.xml.

However, I could not find the way how to change the root in export.

Any ideas, hints?

Cheers,
Tomas

On 13 September 2012 12:49, Jesse Eichar <jesse.eichar@anonymised.com> wrote:

Could you make a trac ticket with this issue? It looks like a good candidate to me. Although I admit I don’t use dublin core so often.

Jesse

On Thu, Sep 13, 2012 at 11:51 AM, Tomas Kliment <tomas.kliment@anonymised.com> wrote:

Dear all,

I would like to ask you why GeoNetwork generates invalid Dublin Core XML file?

I have created a testing record using GN metadata editor - Dublin Core metadata template:

The export to XML is pasted here:

<?xml version="1.0" encoding="UTF-8"?> TESTING MD RECORD TOMAS KLIMENT TEST JRC DESCRIPTION KLIMENT testing resource text/plain eng http://... North 90, South -90, East 180, West -180. Global Fre for testing now tomorrow 2012-09-13T11:39:44 8352f5b4-8be4-4f69-820c-da810f24b988

However it assigns to a schemaLocation attribute simpledc schema, which does not allow elements from dct namespace (dct:created, dct:dateSubmitted etc) thus it causes validation errors:

Element dct:created is not allowed under element .
Reason: The following elements are expected at this location (see below)

Annotations of type 'dc:elementContainer' (see below) This complexType is included as a convenience for schema authors who need to define a root or container element for all of the DC elements. Error location: simpledc / dct:created Details cvc-model-group: Element unexpected by type 'dc:elementContainer' of element . cvc-elt.5.2.1: The element is not valid with respect to the actual type definition 'dc:elementContainer'.

One solution how to resolve this would be to change the schemaLocation and root as follows:

<?xml version="1.0" encoding="UTF-8"?>


dc:titleTESTING MD RECORD</dc:title>
dc:creatorTOMAS KLIMENT</dc:creator>
dc:subjectTEST</dc:subject>
dc:subjectJRC</dc:subject>
dc:descriptionDESCRIPTION</dc:description>
dc:publisherKLIMENT</dc:publisher>
dc:typetesting resource</dc:type>
dc:formattext/plain</dc:format>
dc:languageeng</dc:language>
dc:relationhttp://…</dc:relation>
dc:coverageNorth 90, South -90, East 180, West -180. Global</dc:coverage>
dc:rightsFre for testing</dc:rights>
dct:creatednow</dct:created>
dct:dateSubmittedtomorrow</dct:dateSubmitted>
dct:modified2012-09-13T11:39:44</dct:modified>
dc:identifier8352f5b4-8be4-4f69-820c-da810f24b988</dc:identifier>

To change the Root element from to and schemaLocation to point to qualifieddc.xsd schema.

What would you suggest me? Is this already known issue?

Many thanks in advance for any response,

Best regards,

Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019
Tel: +39 389 4955 954
e-mail: tomas.kliment@anonymised.com
www: http://about.me/klimeto

Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297
e-mail: tomas.kliment@anonymised.com

Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy

External consultant:

Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019
Tel: +39 389 4955 954
e-mail: tomas.kliment@anonymised.com
www: http://about.me/klimeto

Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297
e-mail: tomas.kliment@anonymised.com

Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy

External consultant:

Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com

Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019
Tel: +39 389 4955 954
e-mail: tomas.kliment@anonymised.com
www: http://about.me/klimeto

Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297
e-mail: tomas.kliment@anonymised.com

Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy

External consultant:

Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com

Just had a quick look at this: it seems that the schemaLocation in the schema-ident.xml file should be set to nothing ie. <gns:schemaLocation/>. This will trigger creation of a noNamespaceSchemaLocation attribute set to the URL of the schema.xsd file for the dublin-core schema files used in GeoNetwork eg.

xsi:noNamespaceSchemaLocation="http://localhost:8080/geonetwork/xml/schemas/dublin-core/schema.xsd

This file includes the dct namespace and thus records that use that namespace will (and do) validate against that.

Don't think this needs any fix apart from that - though in passing I thought it would be nice to get the schemaLocation/noNamespaceSchemaLocation from the schema and put it into the xpath environment passed to update-fixed-info.xsl so that it can be used there without the need to replicate it.

This fix should be a lot easier than switching all our dc stuff from simpledc root element to qualifieddc?

Cheers,
Simon
________________________________________
From: Jesse Eichar [jesse.eichar@anonymised.com]
Sent: Friday, 14 September 2012 4:37 AM
To: Tomas Kliment
Cc: GeoNetwork GeoNetwork Developer list
Subject: Re: [GeoNetwork-devel] - Metadata export generates invalid XML Dublin Core file

Do you think you could make a fork in your github account and push your changes there so I can clone it and try it out myself?

I would be happy to help tomorrow (friday) if you do that.

Jesse

On Thu, Sep 13, 2012 at 4:47 PM, Tomas Kliment <tomas.kliment@anonymised.com<mailto:tomas.kliment@anonymised.com>> wrote:
Yes, I found them, concretely this file: xml_dc.xsl
I changed the root from original simpledc to qualifieddc as follows:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform&quot;&gt;

<xsl:template match="/root">
<xsl:apply-templates select="qualifieddc"/>
</xsl:template>

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()[name(self::*)!='geonet:info']"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

However this makes it not possible to be parsed:

XML Parsing Error: no element found
Location: http://localhost:8080/geonetwork-branch-2012-07-25/srv/eng/xml_dublin-core?uuid=306e2a11-cdda-4e18-b31b-0e314728d19c
Line Number 1, Column 39:<?xml version="1.0" encoding="UTF-8"?>
--------------------------------------^

What I do not understand from where this xsl selects it? I guess that it should be from xsl, which presents element in the editor interface, or not?

Thanks,
Tomas

On 13 September 2012 15:33, Jesse Eichar <jesse.eichar@anonymised.com<mailto:jesse.eichar@anonymised.com>> wrote:
I think the export xsl files are in : web/src/main/webapp/xsl/conversion/export

Jesse

On Thu, Sep 13, 2012 at 2:36 PM, Tomas Kliment <tomas.kliment@anonymised.com<mailto:tomas.kliment@anonymised.com>> wrote:
Hi Jesse,

I have opened a ticket pointing out this issue here: #1047 (Metadata export generates invalid XML Dublin Core file) – GeoNetwork opensource Developer website

Meanwhile I tried to change the root and schemaLocation values within the XML and XSLT files related to Dublin Core schema (geonetwork/WEB-INF/data/config/schema_plugins/dublin-core/*.xml/xsl/xsd

I succeeded in changing the schemaLocation URL from changing it in schema-conversion.xml and schema-ident.xml.

However, I could not find the way how to change the root in export.

Any ideas, hints?

Cheers,
Tomas

On 13 September 2012 12:49, Jesse Eichar <jesse.eichar@anonymised.com<mailto:jesse.eichar@anonymised.com>> wrote:
Could you make a trac ticket with this issue? It looks like a good candidate to me. Although I admit I don't use dublin core so often.

Jesse

On Thu, Sep 13, 2012 at 11:51 AM, Tomas Kliment <tomas.kliment@anonymised.com<mailto:tomas.kliment@anonymised.com>> wrote:
Dear all,

I would like to ask you why GeoNetwork generates invalid Dublin Core XML file?

I have created a testing record using GN metadata editor - Dublin Core metadata template:

The export to XML is pasted here:

<?xml version="1.0" encoding="UTF-8"?>
<simpledc xmlns:dc="http://purl.org/dc/elements/1.1/&quot; xmlns:dct="DCMI: DCMI Metadata Terms; xmlns:geonet="http://www.fao.org/geonetwork&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation="http://www.dublincore.org/schemas/xmls/qdc/2008/02/11/simpledc.xsd&quot;&gt;
<dc:title>TESTING MD RECORD</dc:title>
<dc:creator>TOMAS KLIMENT</dc:creator>
<dc:subject>TEST</dc:subject>
<dc:subject>JRC</dc:subject>
<dc:description>DESCRIPTION</dc:description>
<dc:publisher>KLIMENT</dc:publisher>
<dc:type>testing resource</dc:type>
<dc:format>text/plain</dc:format>
<dc:language>eng</dc:language>
<dc:relation>http://…</dc:relation>
<dc:coverage>North 90, South -90, East 180, West -180. Global</dc:coverage>
<dc:rights>Fre for testing</dc:rights>
<dct:created>now</dct:created>
<dct:dateSubmitted>tomorrow</dct:dateSubmitted>
<dct:modified>2012-09-13T11:39:44</dct:modified>
<dc:identifier>8352f5b4-8be4-4f69-820c-da810f24b988</dc:identifier>
</simpledc>

However it assigns to a schemaLocation attribute simpledc schema, which does not allow elements from dct namespace (dct:created, dct:dateSubmitted etc) thus it causes validation errors:

    Element <dct:created> is not allowed under element <simpledc>.
        Reason: The following elements are expected at this location (see below)
            <relation>
            <creator>
            <title>
            <format>
            <rights>
            <identifier>
            <subject>
            <type>
            <source>
            <publisher>
            <contributor>
            <language>
            <coverage>
            <description>
            <date>
        Annotations of type 'dc:elementContainer' (see below)
            This complexType is included as a convenience for schema authors who need to define a root
or container element for all of the DC elements.
        Error location: simpledc / dct:created
        Details
            cvc-model-group: Element <dct:created> unexpected by type 'dc:elementContainer' of element <simpledc>.
            cvc-elt.5.2.1: The element <simpledc> is not valid with respect to the actual type definition 'dc:elementContainer'.

One solution how to resolve this would be to change the schemaLocation and root as follows:

<?xml version="1.0" encoding="UTF-8"?>
<qualifieddc xmlns:dc="DCMI: DCMI Metadata Terms; xmlns:dct="DCMI: DCMI Metadata Terms;
xmlns:geonet="http://www.fao.org/geonetwork&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:noNamespaceSchemaLocation="http://dublincore.org/schemas/xmls/qdc/2008/02/11/qualifieddc.xsd&quot; >
<dc:title>TESTING MD RECORD</dc:title>
<dc:creator>TOMAS KLIMENT</dc:creator>
<dc:subject>TEST</dc:subject>
<dc:subject>JRC</dc:subject>
<dc:description>DESCRIPTION</dc:description>
<dc:publisher>KLIMENT</dc:publisher>
<dc:type>testing resource</dc:type>
<dc:format>text/plain</dc:format>
<dc:language>eng</dc:language>
<dc:relation>http://…</dc:relation>
<dc:coverage>North 90, South -90, East 180, West -180. Global</dc:coverage>
<dc:rights>Fre for testing</dc:rights>
<dct:created>now</dct:created>
<dct:dateSubmitted>tomorrow</dct:dateSubmitted>
<dct:modified>2012-09-13T11:39:44</dct:modified>
<dc:identifier>8352f5b4-8be4-4f69-820c-da810f24b988</dc:identifier>
</qualifieddc>

To change the Root element from <simpledc> to <qualifieddc> and schemaLocation to point to qualifieddc.xsd schema.

What would you suggest me? Is this already known issue?

Many thanks in advance for any response,

Best regards,

--
------------------------------------------------------------------
Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019<tel:%2B421%20907%20232019>
Tel: +39 389 4955 954<tel:%2B39%20389%204955%20954>
e-mail: tomas.kliment@anonymised.com<mailto:tomas.kliment@anonymised.com>
www: Tomáš Kliment - Zagreb, Grad Zagreb, Croatia, University of Zagreb, Doctor (PhD) in Geodesy and Cartography | about.me
-------------------
Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297<tel:%2B421%20259274%20297>
e-mail: tomas.kliment@anonymised.com<mailto:tomas.kliment@anonymised.com>
-------------------
Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy
-------------------
External consultant:
Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com<mailto:tomas.kliment@anonymised.com>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net<mailto:GeoNetwork-devel@anonymised.comforge.net>
geonetwork-devel List Signup and Options
GeoNetwork OpenSource is maintained at GeoNetwork - Geographic Metadata Catalog download | SourceForge.net

--
------------------------------------------------------------------
Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019<tel:%2B421%20907%20232019>
Tel: +39 389 4955 954<tel:%2B39%20389%204955%20954>
e-mail: tomas.kliment@anonymised.com<mailto:tomas.kliment@anonymised.com>
www: Tomáš Kliment - Zagreb, Grad Zagreb, Croatia, University of Zagreb, Doctor (PhD) in Geodesy and Cartography | about.me
-------------------
Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297<tel:%2B421%20259274%20297>
e-mail: tomas.kliment@anonymised.com<mailto:tomas.kliment@anonymised.com>
-------------------
Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy
-------------------
External consultant:
Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com<mailto:tomas.kliment@anonymised.com>

--
------------------------------------------------------------------
Ing. Tomas Kliment

Contact information:

Private:
Juzna 4, 04801 Roznava, Slovakia
Tel: +421 907 232019<tel:%2B421%20907%20232019>
Tel: +39 389 4955 954<tel:%2B39%20389%204955%20954>
e-mail: tomas.kliment@anonymised.com<mailto:tomas.kliment@anonymised.com>
www: Tomáš Kliment - Zagreb, Grad Zagreb, Croatia, University of Zagreb, Doctor (PhD) in Geodesy and Cartography | about.me
-------------------
Ph.D. student:
Slovak University of Technology
Faculty of Civil Engineering
Department of Theoretical Geodesy
Radlinskeho 11, block A, 5th floor
813 68 Bratislava 15, Slovakia
Tel: +421 259274 297<tel:%2B421%20259274%20297>
e-mail: tomas.kliment@anonymised.com<mailto:tomas.kliment@anonymised.com>
-------------------
Ph.D. Internship - Junior Researcher:
The National Research Council
Institute of Marine Science, Venice, Italy
-------------------
External consultant:
Polymedia S.p.A, KIT Digital Company
Joint Research Centre of European Commission, Ispra, Italy
e-mail: tomas.kliment@anonymised.com<mailto:tomas.kliment@anonymised.com>