Skip to content

Commit 7500803

Browse files
authored
option to force xsd schema check for required field (#8294)
* option to force xsd schema check for required field * remove xsd schema check in form builder is required logic * adjust label xml check before dtd checking
1 parent ea92905 commit 7500803

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

web/src/main/webapp/xslt/ui-metadata/form-builder.xsl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,26 @@
106106

107107
<xsl:variable name="isoType" select="if (../@gco:isoType) then ../@gco:isoType else ''"/>
108108

109+
<xsl:variable name="elementCondition" select="gn-fn-metadata:getLabel($schema, name(), $labels, name(..),$isoType, $xpath)/condition" />
110+
109111
<!-- Required status is defined in parent element for
110112
some profiles like ISO19139. If not set, the element
111113
editing information is used.
112114
In view mode, always set to false.
113115
-->
114116
<xsl:variable name="isRequired" as="xs:boolean">
115117
<xsl:choose>
118+
<xsl:when test="$elementCondition = 'mandatory'">
119+
<xsl:value-of select="true()"/>
120+
</xsl:when>
121+
<xsl:when test="$elementCondition = 'optional'">
122+
<xsl:value-of select="false()"/>
123+
</xsl:when>
116124
<xsl:when
117125
test="($parentEditInfo and $parentEditInfo/@min = 1 and $parentEditInfo/@max = 1) or
118126
(not($parentEditInfo) and $editInfo and $editInfo/@min = 1 and $editInfo/@max = 1)">
119127
<xsl:value-of select="true()"/>
120128
</xsl:when>
121-
<xsl:when test="gn-fn-metadata:getLabel($schema, name(), $labels, name(..),$isoType, $xpath)/condition = 'mandatory'">
122-
<xsl:value-of select="true()"/>
123-
</xsl:when>
124129
<xsl:otherwise>
125130
<xsl:value-of select="false()"/>
126131
</xsl:otherwise>

0 commit comments

Comments
 (0)