<xsl:template match="/Root" priority="1">
<ValidationResult>
<!-- Pflichtfelder -->
<xsl:call-template name="ValidatePuzzleCategoryClassData" />
<!-- Spezialfälle abhandeln -->
<xsl:for-each select="cardoExtension:SelectSingleNodeByXPathString(., concat('', @type))">
<xsl:call-template name="Validate_SBP_BBP" />
</xsl:for-each>
</ValidationResult>
</xsl:template>
<xsl:template name="Error">
<xsl:param name="path"/>
<xsl:param name="msg"/>
<Message severity="Error">
<xsl:attribute name="path">
<xsl:value-of select="$path"/>
</xsl:attribute>
<xsl:value-of select="$msg"/>
</Message>
</xsl:template>
<xsl:call-template name="Error">
<xsl:with-param name="path" select="concat($cat, '/H2SUEBERWACHUNG')" />
<xsl:with-param name="msg" select="'Einrichtungen zur H2S-Überwachung müssen angegeben werden.'" />
</xsl:call-template>
<xsl:if test="BOHRLOCHBILDUEBERG/text() != 'true' and not(BOHRLOCHBILDDATEI)">
<xsl:call-template name="Error">
<xsl:with-param name="path" select="concat($cat, '/BOHRLOCHBILDDATEI')" />
<xsl:with-param name="msg" select="'Es muss eine der Angaben ausgefüllt werden.'" />
</xsl:call-template>
</xsl:if>
<xsl:choose>
<xsl:when test="$givenCount = 0">
<xsl:call-template name="Error">
<xsl:with-param name="msg" select="concat('"',$label,'" ist nicht optional.')"/>
<xsl:with-param name="path" select="$path"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="string($minOccurs) != '' and $givenCount < $minOccurs">
<xsl:call-template name="Error">
<xsl:with-param name="msg" select="concat('"',$label,'" muss mindestens ', $minOccurs, 'x angegeben werden.')"/>
<xsl:with-param name="path" select="$path"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
<xsl:template name="Error">
<xsl:param name="path"/>
<xsl:param name="msg"/>
<Message severity="Error">
<xsl:attribute name="path">
<xsl:value-of select="$path"/>
</xsl:attribute>
<xsl:value-of select="$msg"/>
</Message>
</xsl:template>