[GeoNetwork-devel] schema loc files using namespace uri and local-name instead of name of elements ?

Hi all,

in xml/schema/xxx/loc/yy/labels.xml and codelist.xml we defined elements
as :
<element name="gmd:CI_OnlineResource">
  <label>OnLine resource</label>
  <description>information about online sources from which the resource
can be
     obtained</description>
</element>

But if you have a metadata record using another prefix (eg. foo) bind to
http://www.isotc211.org/2005/gmd ,
then translation is not displayed and we have
'[foo:CI_OnlineResource]'.
Same problem if http://www.isotc211.org/2005/gmd is the default
namespace.

Problem is in the getTitle template
<xsl:variable name="schematitle" select="string(/root/gui/*[name(.)=
$schema]/element[@name=$name]/label)"/>

An idea could be to store translation of elements using ns uri:
<element name="CI_OnlineResource" ns="http://www.isotc211.org/2005/gmd&quot;&gt;

... and search translation using local-name and ns uri :
<xsl:variable name="nm" select="name(.)"></xsl:variable>
<xsl:variable name="ns" select="namespace-uri(.)"></xsl:variable>
<xsl:variable name="schematitle" select="string(/root/gui/*[name(.)=
$schema]/element[@name=$nm and @ns=$ns]/label)"/>

Does this sounds good to you ? Do you see any side effect on changing
loc files for schema ?
Anyone facing similar issue ?

Thanks.

Francois

Hi Francois,

Sounds like a viable solution - out of interest, what is the use case where you would have a different prefix bound to the
http://www.isotc211.org/2005/gmd URI? (I know its possible but its kind of confusing if you're simple minded like me and like it to be a URL and resolve to an XSD with info about the elements in that namespace :-))

I've used a slightly different solution for profile support that uses the current layout - for any element in the metadata it looks up the label/help string (from the labels.xml file for the profile eg. iso19139.mcp) and if not found there it refers to the iso19139 label/help info. The idea is that the profile only has info on the elements specific to it. This could still work with your labels.xml structure - its specific to the profile problem.

Cheers,
Simon

Francois-Xavier Prunayre wrote:

Hi all,

in xml/schema/xxx/loc/yy/labels.xml and codelist.xml we defined elements
as :
<element name="gmd:CI_OnlineResource">
  <label>OnLine resource</label>
  <description>information about online sources from which the resource
can be
     obtained</description>
</element>

But if you have a metadata record using another prefix (eg. foo) bind to
GMD — Resource site for ISO/TC 211 Geographic information/Geomatics , then translation is not displayed and we have
'[foo:CI_OnlineResource]'. Same problem if GMD — Resource site for ISO/TC 211 Geographic information/Geomatics is the default
namespace.

Problem is in the getTitle template
<xsl:variable name="schematitle" select="string(/root/gui/*[name(.)=
$schema]/element[@name=$name]/label)"/>

An idea could be to store translation of elements using ns uri:
<element name="CI_OnlineResource" ns="http://www.isotc211.org/2005/gmd&quot;&gt;

... and search translation using local-name and ns uri :
<xsl:variable name="nm" select="name(.)"></xsl:variable>
<xsl:variable name="ns" select="namespace-uri(.)"></xsl:variable>
<xsl:variable name="schematitle" select="string(/root/gui/*[name(.)=
$schema]/element[@name=$nm and @ns=$ns]/label)"/>

Does this sounds good to you ? Do you see any side effect on changing
loc files for schema ?
Anyone facing similar issue ?

Thanks.

Francois

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
geonetwork-devel List Signup and Options
GeoNetwork OpenSource is maintained at GeoNetwork - Geographic Metadata Catalog download | SourceForge.net

Hi Simon,

On mer, 2008-09-24 at 21:45 +1000, Simon Pigot wrote:

Sounds like a viable solution - out of interest, what is the use case
where you would have a different prefix bound to the
http://www.isotc211.org/2005/gmd URI?

2 UC :
* when harvesting some catalogue or folder with XML records (maybe not
managed by GeoNetwork)
* when processing using XSLT on import and sometimes according to the
XSL, I have output with http://www.isotc211.org/2005/gmd as default ns
and also bind to gmd prefix.... not sure if we could force a ns URI /
prefix binding in xsl output properties ?

I've used a slightly different solution for profile support that uses
the current layout - for any element in the metadata it looks up the
label/help string (from the labels.xml file for the profile eg.
iso19139.mcp) and if not found there it refers to the iso19139
label/help info.

This is nice for profils and we have to keep that behaviour (which is in
trunk already).

Cheers.
Francois