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

Editor / Polygon / Fix validation error on srsName and id attributes. #4791

Merged
merged 7 commits into from
Jul 3, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
</xsl:choose>
</xsl:template>


<xsl:template match="gml:LinearRing/@srsName"/>

<xsl:template name="correct_ns_prefix">
<xsl:param name="element"/>
Expand Down
14 changes: 8 additions & 6 deletions schemas/iso19139/src/main/plugin/iso19139/update-fixed-info.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@
<!-- Fix srsName attribute generate CRS:84 (EPSG:4326 with long/lat
ordering) by default -->

<xsl:template match="gml:LinearRing/@srsName"/>

<xsl:template match="@srsName">
<xsl:choose>
<xsl:when test="normalize-space(.)=''">
Expand All @@ -288,10 +290,10 @@
</xsl:template>

<!-- Add required gml attributes if missing -->
<xsl:template match="gml:Polygon[not(@gml:id) and not(@srsName)]|
gml:MultiSurface[not(@gml:id) and not(@srsName)]|
gml:LineString[not(@gml:id) and not(@srsName)]|
gml320:Polygon[not(@gml320:id) and not(@srsName)]">
<xsl:template match="gml:Polygon[not(@gml:id) or not(@srsName)]|
gml:MultiSurface[not(@gml:id) or not(@srsName)]|
gml:LineString[not(@gml:id) or not(@srsName)]|
gml320:Polygon[not(@gml320:id) or not(@srsName)]">
Copy link
Member

Choose a reason for hiding this comment

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

With this change the gml:id or srsName are going to be replaced if 1 of the values are not filled, should not be checked if are filled to copy them instead of setting the value?

<xsl:copy copy-namespaces="no">
<xsl:choose>
<xsl:when test="$isUsing2005Schema and not($isUsing2007Schema)">
Expand Down Expand Up @@ -479,10 +481,10 @@

<xsl:if test="normalize-space(./text()) != '' and string(@codeListValue)">
<xsl:value-of select="java:getIsoLanguageLabel(@codeListValue, $mainLanguage)" />
<!--
<!--
If wanting to get strings from codelists then add gmd:LanguageCode codelist in loc/{lang}/codelists.xml
and use getCodelistTranslation instead of getIsoLanguageLabel. This will allow for custom values such as "eng; USA"
i.e.
i.e.
<xsl:value-of select="java:getCodelistTranslation(name(), string(@codeListValue), string($mainLanguage))"/>
-->
</xsl:if>
Expand Down