[GeoNetwork-devel] [GeoNetwork opensource Developer website] #713: GeoNetwork 2.6.4: error in kml.xsl: wrong XSL variable for layer name (with proposition of solution)

#713: GeoNetwork 2.6.4: error in kml.xsl: wrong XSL variable for layer name (with
proposition of solution)
---------------------------+------------------------------------------------
Reporter: FranckTheeten | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.6.5
Component: General | Version: v2.6.4
Keywords: |
---------------------------+------------------------------------------------
Hi all,

I'm a new GeoNetwork user so I'm not sure I post the issue at the right
location, and that it has not been solved in the meantime.

The problem is the following:
1: I use GeNetwork 2.6.4
2: I've harvested a WMS via OAI-PMH to generate a metadata catalogue.
3: The WMS layers have been indexed with the appropriate keywords and can
be displayed on the interactive map.
4: ...but the file automatically created to view the layer in Google Earth
features an error preventing its display.

I've checked kml.xsl which converts the main xml generated by GeoNetwork
into KML and maybe found a workaround:

b) a) The error comes from incomplete parameters in the WMS "GetMap"
request defined in the "GroundOverlay/Icon/href" and
"ScreenOverLay/Icon/href" elements thatare generated by the xslt:
the value of the LAYERS parameter is missing.

e.g.

{{{
<Icon><href>http://edit.africamuseum.be/geoserver/RMCA_Bedrock_and_Structural_Geology/wms?SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;SERVICE=WMS&amp;SRS=EPSG:4326&amp;WIDTH=512&amp;HEIGHT=512&amp;LAYERS=&amp;TRANSPARENT=TRUE&amp;STYLES=&amp;FORMAT=image/png&amp;&lt;/href&gt;&lt;/Icon&gt;
}}}
.

c) kml.xsl contains the following line (once for ScreenOverlay and once
for GroundOverlay):

{{{
<Icon>
<href><xsl:value-of select="@href"/><xsl:value-of
select="$qm"/>VERSION=1.1.1&#0038;REQUEST=GetMap&#0038;SERVICE=WMS&#0038;SRS=EPSG:4326&#0038;WIDTH=512&#0038;HEIGHT=512&#0038;LAYERS=<xsl
:value-of
select="@name"/>&#0038;TRANSPARENT=TRUE&#0038;STYLES=&#0038;FORMAT=image/png&#0038;</href>
}}}
  (lines 118 and 142 of "kml.xsl")

...but actually the name of the layer is not captured by '''"@name"''' but
by a variable called '''"$layer"''' :

{{{
<xsl:variable name="layer" select="/root/request/layers"/>
}}}
  (line 48 in my GeoNetwork)

So replacing...

{{{
<Icon>
<href><xsl:value-of select="@href"/><xsl:value-of
select="$qm"/>VERSION=1.1.1&#0038;REQUEST=GetMap&#0038;SERVICE=WMS&#0038;SRS=EPSG:4326&#0038;WIDTH=512&#0038;HEIGHT=512&#0038;LAYERS=<xsl
:value-of
select="@name"/>&#0038;TRANSPARENT=TRUE&#0038;STYLES=&#0038;FORMAT=image/png&#0038;</href>
}}}

...by...

{{{
<Icon>
<href><xsl:value-of select="@href"/><xsl:value-of
select="$qm"/>VERSION=1.1.1&#0038;REQUEST=GetMap&#0038;SERVICE=WMS&#0038;SRS=EPSG:4326&#0038;WIDTH=512&#0038;HEIGHT=512&#0038;LAYERS=<xsl
:value-of
select="$layer"/>&#0038;TRANSPARENT=TRUE&#0038;STYLES=&#0038;FORMAT=image/png&#0038;</href>
}}}
"

...in ./geonetwork/xsl/kml.xsl seems to solve the problem.

Maybe the change could be commited to the version stored in the
repository?

Franck Theeten
Web developer and database manager
Royal Museum for Central Africa, Tervuren, Belgium

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/713&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#713: GeoNetwork 2.6.4: error in kml.xsl: wrong XSL variable for layer name (with
proposition of solution)
---------------------------+------------------------------------------------
Reporter: FranckTheeten | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone:
Component: General | Version: v2.6.4
Keywords: |
---------------------------+------------------------------------------------
Changes (by FranckTheeten):

  * milestone: v2.6.5 =>

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/713#comment:1&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#713: GeoNetwork 2.6.4: error in kml.xsl: wrong XSL variable for layer name (with
proposition of solution)
---------------------------+------------------------------------------------
Reporter: FranckTheeten | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: Future release
Component: General | Version: v2.6.4
Keywords: |
---------------------------+------------------------------------------------
Changes (by FranckTheeten):

  * milestone: => Future release

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/713#comment:2&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.