Skip to content

Commit

Permalink
option to force xsd schema check for required field (#8294)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
wangf1122 authored Oct 29, 2024
1 parent ea92905 commit 7500803
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions web/src/main/webapp/xslt/ui-metadata/form-builder.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,26 @@

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

<xsl:variable name="elementCondition" select="gn-fn-metadata:getLabel($schema, name(), $labels, name(..),$isoType, $xpath)/condition" />

<!-- Required status is defined in parent element for
some profiles like ISO19139. If not set, the element
editing information is used.
In view mode, always set to false.
-->
<xsl:variable name="isRequired" as="xs:boolean">
<xsl:choose>
<xsl:when test="$elementCondition = 'mandatory'">
<xsl:value-of select="true()"/>
</xsl:when>
<xsl:when test="$elementCondition = 'optional'">
<xsl:value-of select="false()"/>
</xsl:when>
<xsl:when
test="($parentEditInfo and $parentEditInfo/@min = 1 and $parentEditInfo/@max = 1) or
(not($parentEditInfo) and $editInfo and $editInfo/@min = 1 and $editInfo/@max = 1)">
<xsl:value-of select="true()"/>
</xsl:when>
<xsl:when test="gn-fn-metadata:getLabel($schema, name(), $labels, name(..),$isoType, $xpath)/condition = 'mandatory'">
<xsl:value-of select="true()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="false()"/>
</xsl:otherwise>
Expand Down

0 comments on commit 7500803

Please sign in to comment.