Skip to content

Commit

Permalink
Fix : forced max length to 10 for code list which references another …
Browse files Browse the repository at this point in the history
…code list
  • Loading branch information
loichenninger committed Sep 6, 2024
1 parent af53385 commit 2399e7f
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/main/resources/xslt/structured-variables.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,20 @@
TODO : prendre en compte les listes de codes qui en référencent d'autres</xd:desc>
</xd:doc>
<xsl:template match="l:CodeList" mode="CodesMaxlength">
<xsl:variable name="max-length">
<xsl:for-each select="l:Code/string-length(r:Value)">
<xsl:sort data-type="number" order="descending" />
<xsl:if test="position()=1">
<xsl:value-of select="." />
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="max($max-length)"/>
<xsl:choose>
<xsl:when test="l:Code">
<xsl:variable name="max-length">
<xsl:for-each select="l:Code/string-length(r:Value)">
<xsl:sort data-type="number" order="descending" />
<xsl:if test="position()=1">
<xsl:value-of select="." />
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="max($max-length)"/>
</xsl:when>
<xsl:otherwise>10</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xd:doc>
Expand Down

0 comments on commit 2399e7f

Please sign in to comment.