Opened 12 years ago

Closed 12 years ago

#1032 closed defect (fixed)

update-fixed-info.xsl for mcp schemas (1.4 an 1.5-expermental) adds faulty xsi:schemaLocation

Reported by: awalsh Owned by: geonetwork-devel@…
Priority: major Milestone: v2.8.0 RC0
Component: Metadata standards Version: v2.8.0RC0
Keywords: MCP schema Cc: simon.pigot@…

Description

Using Latest GN2.8+ANZMEST update-fixed-info.xsl runs whenever you do an edit/save/close. update-fixed-info.xsl updates the xsi:SchemaLocation in the root element or adds one if missing.

The problem is that the xsi:SchemaLocation is faulty and fails schema URL lookup when opening with an XML editor such as XML spy.

(This issue appears to have been introduced back with the BlueNet V1.4.2 of Geonetwork and has been copied across with the introduction of the mcp schema plugins to the V2.8 GN)

This is the xsi:SchemaLocation added for mcp 1.4 schema:

xsi:schemaLocation="
				http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd http://www.isotc211.org/2005/srv http://schemas.opengis.net/iso/19139/20060504/srv/srv.xsd http://bluenet3.antcrc.utas.edu.au/mcp http://bluenet3.antcrc.utas.edu.au/mcp-1.4/schema.xsd
			"

2 problems are evident:

  1. The start and end of the schemaLocation contains html encoded newline and TAB characters these cause schema URL

lookup to fail.

  1. The schemaLocation references gmd.xsd, then srv.xsd and then

mcp-1.4 schema.xsd. This causes an 'already referenced element' schema lookup error because the mcp schema also contains gmd and srv schema. To fix this issue refer to the mcp-1.4 schema only.

For the mcp-1.5-experimental schema the schema Location added is:

xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd http://www.isotc211.org/2005/srv http://schemas.opengis.net/iso/19139/20060504/srv/srv.xsd http://bluenet3.antcrc.utas.edu.au/mcp http://bluenet3.antcrc.utas.edu.au/mcp-1.5-experimental/schema.xsd"

The mcp-1.5 doesn't have the newline/tab issue but still the 'already referenced element' issue.

The is the suggested fix to the mcp-1.4 update-fixed-info.xsl

Replace lines 32-34 (note embedded newline+tab problem within XML element contents):

<xsl:attribute name="xsi:schemaLocation">

http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd http://www.isotc211.org/2005/srv http://schemas.opengis.net/iso/19139/20060504/srv/srv.xsd http://bluenet3.antcrc.utas.edu.au/mcp http://bluenet3.antcrc.utas.edu.au/mcp-1.4/schema.xsd

</xsl:attribute>

with <xsl:attribute name="xsi:schemaLocation">http://bluenet3.antcrc.utas.edu.au/mcp http://bluenet3.antcrc.utas.edu.au/mcp-1.4/schema.xsd</xsl:attribute>

Note: the text within the <xsl:attribute> is a single string with no line breaks

The is the suggested fix to the mcp-1.5-experimental update-fixed-info.xsl:

Replace line 32:

<xsl:attribute name="xsi:schemaLocation">http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd http://www.isotc211.org/2005/srv http://schemas.opengis.net/iso/19139/20060504/srv/srv.xsd http://bluenet3.antcrc.utas.edu.au/mcp http://bluenet3.antcrc.utas.edu.au/mcp-1.5-experimental/schema.xsd</xsl:attribute>

with:

<xsl:attribute name="xsi:schemaLocation">http://bluenet3.antcrc.utas.edu.au/mcp http://bluenet3.antcrc.utas.edu.au/mcp-1.5-experimental/schema.xsd</xsl:attribute>

Change History (3)

comment:1 by awalsh, 12 years ago

Summary: update-fxed-info.xsl fro mcp schemas (1.4 an 1.5-expermental) adds faulty xsi:schemaLocationupdate-fixed-info.xsl for mcp schemas (1.4 an 1.5-expermental) adds faulty xsi:schemaLocation

Fix typo. in title.

comment:2 by awalsh, 12 years ago

I have now tested the suggested fixes and they work OK. I run edit/save/close on some existing mcp1.4 and mcp-1.5-experimental records. The revised xsi:schemaLocations added validate the XML correctly when using an external XML editor such as XML Spy.

comment:3 by simonp, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in commit b19fe403275cb1233c085f9a22b7445e81113960

Note: See TracTickets for help on using tickets.