Xsl templates in ISO19139 schema handling codelists

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Xsl templates in ISO19139 schema handling codelists

Jose Garcia
Hi

I see this code to handle codelists in ISO19139 schema:

https://github.com/geonetwork/core-geonetwork/blob/3.4.x/schemas/iso19139/src/main/plugin/iso19139/layout/layout.xsl#L503


In both cases are used for codelists the specific values for iso19139 ($iso19139codelists) instead of $codelists that contains the values in the schema of the metadata edited. While for labels is used $labels that contain the labels for the metadata schema (so allows override in a custom schema the values and still work with that templates):

<xsl:param name="labels" select="$labels" required="no"/>
<xsl:param name="codelists" select="$iso19139codelists" required="no"/>

See variables defined in:


  <xsl:variable name="schemaInfo" select="/root/gui/schemas/*[name(.)=$schema]"/>
  <xsl:variable name="labels" select="$schemaInfo/labels"/>
  <xsl:variable name="codelists" select="$schemaInfo/codelists"/>
  <xsl:variable name="strings" select="$schemaInfo/strings"/>

  <xsl:variable name="iso19139schema" select="/root/gui/schemas/iso19139"/>
  <xsl:variable name="iso19139labels" select="$iso19139schema/labels"/>
  <xsl:variable name="iso19139codelists" select="$iso19139schema/codelists"/>
  <xsl:variable name="iso19139strings" select="$iso19139schema/strings"/>


Not sure if there's any reason for this that I could be missing or it's a bug?

Regards,
Jose García
--
Vriendelijke groeten / Kind regards,

Jose García


Veenderweg 13
6721 WD Bennekom
The Netherlands
T: <a href="tel:+31318416664" style="font-family:Helvetica,Arial,sans-serif" target="_blank">+31 (0)318 416664

  

Please consider the environment before printing this email.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Xsl templates in ISO19139 schema handling codelists

Francois Prunayre
Hi Jose,

Le lun. 11 juin 2018 à 10:30, Jose Garcia <[hidden email]> a écrit :
Hi

I see this code to handle codelists in ISO19139 schema:

https://github.com/geonetwork/core-geonetwork/blob/3.4.x/schemas/iso19139/src/main/plugin/iso19139/layout/layout.xsl#L503


In both cases are used for codelists the specific values for iso19139 ($iso19139codelists) instead of $codelists that contains the values in the schema of the metadata edited. While for labels is used $labels that contain the labels for the metadata schema (so allows override in a custom schema the values and still work with that templates):

Some ISO19139 based schema are not extended the codelists so it makes things easy in that case. I think that was the reason to have the default value of the param set to 19139 codelist. You can define your schema codelist
<xsl:template mode="mode-iso19139-xyz" priority="201" match="*[*/@codeList]">
and then call the mode-iso19139 template with your overridden codelist if needed ?

Francois
 

 

<xsl:param name="labels" select="$labels" required="no"/>
<xsl:param name="codelists" select="$iso19139codelists" required="no"/>

See variables defined in:


  <xsl:variable name="schemaInfo" select="/root/gui/schemas/*[name(.)=$schema]"/>
  <xsl:variable name="labels" select="$schemaInfo/labels"/>
  <xsl:variable name="codelists" select="$schemaInfo/codelists"/>
  <xsl:variable name="strings" select="$schemaInfo/strings"/>

  <xsl:variable name="iso19139schema" select="/root/gui/schemas/iso19139"/>
  <xsl:variable name="iso19139labels" select="$iso19139schema/labels"/>
  <xsl:variable name="iso19139codelists" select="$iso19139schema/codelists"/>
  <xsl:variable name="iso19139strings" select="$iso19139schema/strings"/>


Not sure if there's any reason for this that I could be missing or it's a bug?

Regards,
Jose García
--
Vriendelijke groeten / Kind regards,

Jose García


Veenderweg 13
6721 WD Bennekom
The Netherlands
T: <a href="tel:+31318416664" style="font-family:Helvetica,Arial,sans-serif" target="_blank">+31 (0)318 416664

  

Please consider the environment before printing this email.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
GeoNetwork-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Xsl templates in ISO19139 schema handling codelists

Jose Garcia
Hi Francois

Thanks, I'll give a try to that.

Regards,
Jose García


On Mon, Jun 11, 2018 at 10:37 AM, Francois Prunayre <[hidden email]> wrote:
Hi Jose,

Le lun. 11 juin 2018 à 10:30, Jose Garcia <[hidden email]> a écrit :
Hi

I see this code to handle codelists in ISO19139 schema:

https://github.com/geonetwork/core-geonetwork/blob/3.4.x/schemas/iso19139/src/main/plugin/iso19139/layout/layout.xsl#L503


In both cases are used for codelists the specific values for iso19139 ($iso19139codelists) instead of $codelists that contains the values in the schema of the metadata edited. While for labels is used $labels that contain the labels for the metadata schema (so allows override in a custom schema the values and still work with that templates):

Some ISO19139 based schema are not extended the codelists so it makes things easy in that case. I think that was the reason to have the default value of the param set to 19139 codelist. You can define your schema codelist
<xsl:template mode="mode-iso19139-xyz" priority="201" match="*[*/@codeList]">
and then call the mode-iso19139 template with your overridden codelist if needed ?

Francois
 

 

<xsl:param name="labels" select="$labels" required="no"/>
<xsl:param name="codelists" select="$iso19139codelists" required="no"/>

See variables defined in:


  <xsl:variable name="schemaInfo" select="/root/gui/schemas/*[name(.)=$schema]"/>
  <xsl:variable name="labels" select="$schemaInfo/labels"/>
  <xsl:variable name="codelists" select="$schemaInfo/codelists"/>
  <xsl:variable name="strings" select="$schemaInfo/strings"/>

  <xsl:variable name="iso19139schema" select="/root/gui/schemas/iso19139"/>
  <xsl:variable name="iso19139labels" select="$iso19139schema/labels"/>
  <xsl:variable name="iso19139codelists" select="$iso19139schema/codelists"/>
  <xsl:variable name="iso19139strings" select="$iso19139schema/strings"/>


Not sure if there's any reason for this that I could be missing or it's a bug?

Regards,
Jose García
--
Vriendelijke groeten / Kind regards,

Jose García


Veenderweg 13
6721 WD Bennekom
The Netherlands
T: <a href="tel:+31318416664" style="font-family:Helvetica,Arial,sans-serif" target="_blank">+31 (0)318 416664

  

Please consider the environment before printing this email.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
GeoNetwork-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork



--
Vriendelijke groeten / Kind regards,

Jose García


Veenderweg 13
6721 WD Bennekom
The Netherlands
T: <a href="tel:+31318416664" style="font-family:Helvetica,Arial,sans-serif" target="_blank">+31 (0)318 416664

  

Please consider the environment before printing this email.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork