Skip to content

Commit

Permalink
[BP] Standard / Feature catalogues / Do not index empty codelist value (
Browse files Browse the repository at this point in the history
#7440)

Ignore empty codelist value (but it is better to not leave empty
codelist value in encoded records).
  • Loading branch information
fxprunayre authored and josegar74 committed Oct 20, 2023
1 parent 6d327e6 commit 76314a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@
<xsl:if test="*/gfc:cardinality">
,"cardinality": "<xsl:value-of select="concat(*/gfc:cardinality//gco:lower/*/text(), '..', */gfc:cardinality//gco:upper/*/text())"/>"
</xsl:if>
<xsl:if test="*/gfc:listedValue">
<xsl:variable name="codeList"
select="*/gfc:listedValue[normalize-space(*) != '']"/>
<xsl:if test="$codeList">
,"values": [
<xsl:for-each select="*/gfc:listedValue">{
<xsl:for-each select="$codeList">{
"label": "<xsl:value-of select="gn-fn-index:json-escape(*/gfc:label/*/text())"/>",
"code": "<xsl:value-of select="gn-fn-index:json-escape(*/gfc:code/*/text())"/>",
"definition": "<xsl:value-of select="gn-fn-index:json-escape(*/gfc:definition/*/text())"/>"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1026,9 +1026,11 @@
<xsl:if test="*/gfc:cardinality">
,"cardinality": "<xsl:value-of select="gn-fn-index:json-escape(*/gfc:cardinality/*/text())"/>"
</xsl:if>
<xsl:if test="*/gfc:listedValue">
<xsl:variable name="codeList"
select="*/gfc:listedValue[normalize-space(*) != '']"/>
<xsl:if test="$codeList">
,"values": [
<xsl:for-each select="*/gfc:listedValue">{
<xsl:for-each select="$codeList">{
"label": "<xsl:value-of select="gn-fn-index:json-escape(*/gfc:label/gco:CharacterString/text())"/>",
"code": "<xsl:value-of select="gn-fn-index:json-escape(*/gfc:code/*/text())"/>",
"definition": "<xsl:value-of select="gn-fn-index:json-escape(*/gfc:definition/gco:CharacterString/text())"/>"}
Expand Down

0 comments on commit 76314a7

Please sign in to comment.