Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit of Meansurement (uom) rendering issue #415

Open
wangf1122 opened this issue Nov 25, 2024 · 2 comments
Open

Unit of Meansurement (uom) rendering issue #415

wangf1122 opened this issue Nov 25, 2024 · 2 comments

Comments

@wangf1122
Copy link
Contributor

The current UI is not able to handle HNAP uom spec

image

<gco:Distance uom="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/uom/gmxUom.xml#m">1</gco:Distance>

The ISO13139 standard has no such url as part of the uom part.

 <gco:Distance uom="m">10</gco:Distance>

So wonder why HNAP needs such url and how to make the UI handle such url?

@josegar74
Copy link
Contributor

I've seen both cases. The file gmxUom.xml seems containing kind of codelist https://github.com/geonetwork/core-geonetwork/blob/main/schemas/iso19139/src/main/plugin/iso19139/schema/resources/uom/gmxUom.xml

I don't think HNAP enforces it, at least I don't find that in the specification.

In any case, the code enforcing it is

<xsl:template match="gco:Distance">
<xsl:element name="gco:{local-name()}">
<xsl:apply-templates select="@*"/>
<xsl:choose>
<!--Avoid append the url recursively. Only append the url once. -->
<xsl:when test="not(starts-with(@uom, 'http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/uom/gmxUom.xml#'))">
<xsl:attribute name="uom">http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/uom/gmxUom.xml#<xsl:value-of select="@uom"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="uom"><xsl:value-of select="@uom"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="node()"/>
</xsl:element>
</xsl:template>

Maybe can be added a variable in the xsl to enforce the URL or use the provided value as it is.

@wangf1122
Copy link
Contributor Author

wangf1122 commented Nov 26, 2024

@josegar74

Do you mean in the current HNAP schema enforcing logic which is the /update-fixed-info.xsl

We should not append the url to the unit. We should use the unit as is? What I understand it the codelist in HNAP which been pointed is same as what ISO19139 looks like. So I dont see any advantage to add such url in front of the unit like:

"http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/uom/gmxUom.xml#m"
instead of
"m"

I have created a pull request to get this url removed in update-fixed-info

#417 and make it same as how indexing works

<xsl:value-of select="if (contains(@uom, '#'))
then concat(., ' ', tokenize(@uom, '#')[2])
else concat(., ' ', @uom)"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants