Skip to content

Conversation

@tylerjmchugh
Copy link
Contributor

With the current online resources validation it can be unclear to the user that there are empty alternate language values. If a user manually inputs PDF in the format field without clicking the typeahead suggestion, the French value will not be updated:

image
image

This produces the following validation message:

.../Sample_Valid.pdf : Online resource description format is not valid. Valid values are:AAC, AIFF, APK, ASCII Grid, AVI, BAG, BMP, BWF, CCT, CDED ASCII, CDF, CDR, COD, CSV, DBD, DBF, DICOM, DNG, DOC, DOCX, DXF, E00, ECW, EDI, EMF, EPS, EPUB2, EPUB3, ESRI REST, EXE, FGDB/GDB, Flat raster binary, GDB, GEOJSON, GeoPDF, GeoRSS, GeoTIF, GIF, GML, GPKG, GRD, GRIB1, GRIB2, HDF, HTML, IATI, IPA, JAR, JFIF, JP2, JPG, JSON, JSONL, JSONLD, KML, KMZ, LAS, LYR, MOV, MP3, MPEG, MPEG-1, MXD, MXF, NetCDF, NT, ODP, ODS, ODT, other, PDF, PDF/A-1, PDF/A-2, PDF/UA, PNG, PPT, PPTX, RDF, RDFa, RSS, RTF, SAR, SAV, SEGY, SHP, SQL, SQLITE, SQLITE3, SVG, TAB, TFW, TIFF, TRIG, TRIX, TTL, TXT, VPF, WAV, WCS, Web App, WFS, WMS, WMTS, WMV, WPS, XLS, XLSM, XLSX, XML, ZIP

This message is confusing as it does not specify it is the French value that is missing. Additionally there is a space missing after the colon in this message.

This PR aims to fix these issues by adding new validation messages specific to missing or invalid values for each language and by implementing these messages in the schematron. Additionally the messages that were missing spaces after colons have been updated with the missing spaces.

@ianwallen ianwallen requested a review from josegar74 June 12, 2025 18:23
@ianwallen ianwallen added this to the 4.4.9 milestone Jun 12, 2025
Copy link
Contributor

@josegar74 josegar74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you test the validation in GeoNetwork main branch, for me with and without the fix the validation error shows a key like $locMsgFormatMissingAltLang, instead of the translation.


The problem seems related to the usage of geonet:appendLocaleMessage like in:

<sch:let name="locMsgMainLang" value="geonet:appendLocaleMessage($loc/strings/*[name() = concat('ContactGovAllowed', $mainLanguageText)], $governmentNamesStringMainLang)" />
<sch:assert test="not($isErrorContactGovMainAllowed)">$locMsgMainLang</sch:assert>

Messages using the schematrons translations directly work, like:

<sch:assert
test="($missing and $missingOtherLang) or (not($missing) and not($missingOtherLang))"
>$loc/strings/ContactPositionName</sch:assert>


UPDATE:

This seems related to some GeoNetwork change, the 4.2.x xslt generated from the sch file contains:

<svrl:text>
  <xsl:copy-of select="$locMsgLang"/>
</svrl:text>

In the new version:

<svrl:text>$locMsgLang</svrl:text>

It's not related to the pull request, it's related to this recent change in GeoNetwork: geonetwork/core-geonetwork@305b1cc

josegar74 referenced this pull request in geonetwork/core-geonetwork Jun 19, 2025
- added xslt helper function to replace placeholders
- made sure shared strings can be used for the schematron localisation (schematron-shared.xml)
- fix in iso_svrl_for_xslt2.xsl to make sure $loc is also used when wrapped in a function
Copy link
Contributor

@josegar74 josegar74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine.

I have created this PR for GeoNetwork main to fix the issue about the messages in main: geonetwork/core-geonetwork#8878

In 4.2.x is not required the previous PR.

@ianwallen ianwallen merged commit c801410 into metadata101:4.4.x Jun 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants