Closed tylerjmchugh closed 3 months ago
@tylerjmchugh Some of the items that you are changing in tpl-csv.xsl may be better fixed in the geonetwork core iso19139 base code as I would expect that the bugs are in that templates as well.
@josegar74 do you see any reason to have HNAP specific implementation for this code? Seems like most of the change can be applied to https://github.com/geonetwork/core-geonetwork/blob/6de7305e63cb08b7976b91e9473e90d750b88483/schemas/iso19139/src/main/plugin/iso19139/layout/tpl-csv.xsl and maybe even https://github.com/geonetwork/core-geonetwork/blob/6de7305e63cb08b7976b91e9473e90d750b88483/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/layout/tpl-csv.xsl
I guess there is a reason for HNAP to have it's own version HNAP stores codelist as RI* values and it puts the value as both English and French like the following HNAP has special code which uses the RI* code to lookup the code list to get the proper value to be displayed.
I believe it is something like this, but you will need to look into it.
<xsl:apply-templates mode="render-value" select="*/@codeListValue"/>
I guess there is a reason for HNAP to have it's own version HNAP stores codelist as RI* values and it puts the value as both English and French like the following HNAP has special code which uses the RI* code to lookup the code list to get the proper value to be displayed.
I believe it is something like this, but you will need to look into it.
<xsl:apply-templates mode="render-value" select="*/@codeListValue"/>
I'm still trying to figure out how the render-value template relates to the RI Codes.
Right now I am getting the codelist myself:
Then I am getting the value element for the entry with a code that matches the RI code. And then I am getting the text before the first semi-colon (english text):
I figured that using just the english is ok for a column key as the codelist values are known and there should always be an english value. I found similar logic in other HNAP files and geonetwork functions.
Is something like this acceptable?
I also saw some examples of the RI code to readable string mapping being done with hardcoded variables but I figure using the codelist is better.
@tylerjmchugh
I figured that using just the english is ok for a column key as the codelist values are known and there should always be an english value. I found similar logic in other HNAP files and geonetwork functions.
Using @codeListValue
would be more accurate however I do see what you mean. There seems to be lots of cases that are using tokenize()
.
@josegar74, What is the best way to get the language values?
i.e. in the following
<gmd:dateType>
<gmd:CI_DateTypeCode codeList="http://nap.geogratis.gc.ca/metadata/register/napMetadataRegister.xml#IC_87" codeListValue="RI_366">creation; création</gmd:CI_DateTypeCode>
</gmd:dateType>
It seems like getting RI_366 from codelist would be the correct way to get the value. Parsing creation; création
seems like it can be buggy and cause issues getting the data based on different languages.
Can you give some guidance.
The codes like RI_366
are translated in the codelist files (label
element):
But I think should be quite safe to parse the value creation; création
as in HNAP for the codelist fields in the XML contains the format English value;French value
.
HNAP Schema is using the iso19139 csv. Added a tpl-csv.xsl customized for HNAP, copied from iso19139's tpl-csv.xsl.
RI codes used in column names are mapped to a meaningful and readable string using codelists.
Without this PR the HNAP headers look like this
Values should come from codelists.
Updated some issues related to thesaurus keywords.
Reference system element added so that geoBox coordinates can be used appropriately.