Skip to content

Commit

Permalink
aangepaste dateTime check
Browse files Browse the repository at this point in the history
  • Loading branch information
RLHuisman committed Jul 23, 2024
1 parent 1f978a5 commit 05e65c2
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,31 @@
<xsl:variable name="elementName" select="string($context/name())"/>
<xsl:variable name="elementLocalName" select="string($context/local-name())"/>
<xsl:variable name="messageBase" select="replace(string-join(( 'Datum in het element', $field, 'bij', $elementLocalName, $prGUID, 'ligt niet voor'), ' '), ' ', ' ')"/>
<xsl:variable name="value" select="xsi:dateTime($context/*[local-name()=$field])"/>
<xsl:variable name="value" select="$context/*[local-name()=$field]"/>
<xsl:variable name="valueDate">
<xsl:choose>
<xsl:when test="($value castable as xsi:date)">
<xsl:copy-of select="xsi:date($value)"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="xsi:dateTime($value)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="checkDate">
<xsl:choose>
<xsl:when test="$date='current'">
<xsl:value-of select="current-dateTime()"/>
</xsl:when>
<xsl:when test="contains($date, '-')">
<xsl:when test="contains($date, '-') and ($date castable as xsi:dateTime)">
<xsl:copy-of select="xsi:dateTime($date)"/>
</xsl:when>
<xsl:when test="contains($date, '-') and ($date castable as xsi:date)">
<xsl:copy-of select="xsi:date($date)"/>
</xsl:when>
<xsl:when test="($context/*[local-name()=$date] castable as xsi:date)">
<xsl:copy-of select="xsi:date($context/*[local-name()=$date])"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="xsi:dateTime($context/*[local-name()=$date])"/>
</xsl:otherwise>
Expand All @@ -444,7 +460,7 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$value &gt;= $checkDate">
<xsl:if test="$valueDate &gt;= $checkDate">
<xsl:copy-of select="sikb:createRecord($errorType, $elementName, $message)"/>
</xsl:if>
</xsl:function>
Expand All @@ -457,15 +473,31 @@
<xsl:variable name="elementName" select="string($context/name())"/>
<xsl:variable name="elementLocalName" select="string($context/local-name())"/>
<xsl:variable name="messageBase" select="replace(string-join(( 'Datum in het element', $field, 'bij', $elementLocalName, $prGUID, 'ligt niet na'), ' '), ' ', ' ')"/>
<xsl:variable name="value" select="xsi:dateTime($context/*[local-name()=$field])"/>
<xsl:variable name="value" select="$context/*[local-name()=$field]"/>
<xsl:variable name="valueDate">
<xsl:choose>
<xsl:when test="($value castable as xsi:date)">
<xsl:copy-of select="xsi:date($value)"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="xsi:dateTime($value)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="checkDate">
<xsl:choose>
<xsl:when test="$date='current'">
<xsl:value-of select="current-dateTime()"/>
</xsl:when>
<xsl:when test="contains($date, '-')">
<xsl:when test="contains($date, '-') and ($date castable as xsi:dateTime)">
<xsl:copy-of select="xsi:dateTime($date)"/>
</xsl:when>
<xsl:when test="contains($date, '-') and ($date castable as xsi:date)">
<xsl:copy-of select="xsi:date($date)"/>
</xsl:when>
<xsl:when test="($context/*[local-name()=$date] castable as xsi:date)">
<xsl:copy-of select="xsi:date($context/*[local-name()=$date])"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="xsi:dateTime($context/*[local-name()=$date])"/>
</xsl:otherwise>
Expand All @@ -484,7 +516,7 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$value &lt;= $checkDate">
<xsl:if test="$valueDate &lt;= $checkDate">
<xsl:copy-of select="sikb:createRecord($errorType, $elementName, $message)"/>
</xsl:if>
</xsl:function>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- XSLT Onderzoek_Controle.xsl versie 1.0.0 (27-6-2024) - SIKB0101 versie 14.8.0-->
<!-- XSLT Onderzoek_Controle.xsl versie 1.1.0 (23-7-2024) - SIKB0101 versie 14.8.0-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes" xmlns:imsikb0101="http://www.sikb.nl/imsikb0101" xmlns:immetingen="http://www.sikb.nl/immetingen" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gsr="http://www.isotc211.org/2005/gsr" xmlns:gss="http://www.isotc211.org/2005/gss" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:om="http://www.opengis.net/om/2.0" xmlns:sam="http://www.opengis.net/sampling/2.0" xmlns:sams="http://www.opengis.net/samplingSpatial/2.0" xmlns:spec="http://www.opengis.net/samplingSpecimen/2.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sikb="http://xslcontrole.sikb" xmlns:issad="http://www.broservices.nl/xsd/issad/1.0" xsi:schemaLocation="http://www.broservices.nl/xsd/issad/1.0 .//issad-messages.xsd">
<xsl:output method="xml" indent="yes"/>
<!-- global variables -->
Expand Down Expand Up @@ -451,15 +451,31 @@
<xsl:variable name="elementName" select="string($context/name())"/>
<xsl:variable name="elementLocalName" select="string($context/local-name())"/>
<xsl:variable name="messageBase" select="replace(string-join(( 'Datum in het element', $field, 'bij', $elementLocalName, $prGUID, 'ligt niet voor'), ' '), ' ', ' ')"/>
<xsl:variable name="value" select="xsi:dateTime($context/*[local-name()=$field])"/>
<xsl:variable name="value" select="$context/*[local-name()=$field]"/>
<xsl:variable name="valueDate">
<xsl:choose>
<xsl:when test="($value castable as xsi:date)">
<xsl:copy-of select="xsi:date($value)"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="xsi:dateTime($value)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="checkDate">
<xsl:choose>
<xsl:when test="$date='current'">
<xsl:value-of select="current-dateTime()"/>
</xsl:when>
<xsl:when test="contains($date, '-')">
<xsl:when test="contains($date, '-') and ($date castable as xsi:dateTime)">
<xsl:copy-of select="xsi:dateTime($date)"/>
</xsl:when>
<xsl:when test="contains($date, '-') and ($date castable as xsi:date)">
<xsl:copy-of select="xsi:date($date)"/>
</xsl:when>
<xsl:when test="($context/*[local-name()=$date] castable as xsi:date)">
<xsl:copy-of select="xsi:date($context/*[local-name()=$date])"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="xsi:dateTime($context/*[local-name()=$date])"/>
</xsl:otherwise>
Expand All @@ -478,7 +494,7 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$value &gt;= $checkDate">
<xsl:if test="$valueDate &gt;= $checkDate">
<xsl:copy-of select="sikb:createRecord($errorType, $elementName, $message)"/>
</xsl:if>
</xsl:function>
Expand All @@ -491,15 +507,31 @@
<xsl:variable name="elementName" select="string($context/name())"/>
<xsl:variable name="elementLocalName" select="string($context/local-name())"/>
<xsl:variable name="messageBase" select="replace(string-join(( 'Datum in het element', $field, 'bij', $elementLocalName, $prGUID, 'ligt niet na'), ' '), ' ', ' ')"/>
<xsl:variable name="value" select="xsi:dateTime($context/*[local-name()=$field])"/>
<xsl:variable name="value" select="$context/*[local-name()=$field]"/>
<xsl:variable name="valueDate">
<xsl:choose>
<xsl:when test="($value castable as xsi:date)">
<xsl:copy-of select="xsi:date($value)"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="xsi:dateTime($value)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="checkDate">
<xsl:choose>
<xsl:when test="$date='current'">
<xsl:value-of select="current-dateTime()"/>
</xsl:when>
<xsl:when test="contains($date, '-')">
<xsl:when test="contains($date, '-') and ($date castable as xsi:dateTime)">
<xsl:copy-of select="xsi:dateTime($date)"/>
</xsl:when>
<xsl:when test="contains($date, '-') and ($date castable as xsi:date)">
<xsl:copy-of select="xsi:date($date)"/>
</xsl:when>
<xsl:when test="($context/*[local-name()=$date] castable as xsi:date)">
<xsl:copy-of select="xsi:date($context/*[local-name()=$date])"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="xsi:dateTime($context/*[local-name()=$date])"/>
</xsl:otherwise>
Expand All @@ -518,7 +550,7 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$value &lt;= $checkDate">
<xsl:if test="$valueDate &lt;= $checkDate">
<xsl:copy-of select="sikb:createRecord($errorType, $elementName, $message)"/>
</xsl:if>
</xsl:function>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- XSLT Onderzoek_Controle.xsl versie 1.0.0 (27-6-2024) - SIKB0101 versie 14.8.0-->
<!-- XSLT Onderzoek_Controle.xsl versie 1.1.0 (23-7-2024) - SIKB0101 versie 14.8.0-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes" xmlns:imsikb0101="http://www.sikb.nl/imsikb0101" xmlns:immetingen="http://www.sikb.nl/immetingen" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gsr="http://www.isotc211.org/2005/gsr" xmlns:gss="http://www.isotc211.org/2005/gss" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:om="http://www.opengis.net/om/2.0" xmlns:sam="http://www.opengis.net/sampling/2.0" xmlns:sams="http://www.opengis.net/samplingSpatial/2.0" xmlns:spec="http://www.opengis.net/samplingSpecimen/2.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sikb="http://xslcontrole.sikb" xmlns:issad="http://www.broservices.nl/xsd/issad/1.0" xsi:schemaLocation="http://www.broservices.nl/xsd/issad/1.0 .//issad-messages.xsd">
<xsl:output method="xml" indent="yes"/>
<!-- global variables -->
Expand Down Expand Up @@ -449,15 +449,31 @@
<xsl:variable name="elementName" select="string($context/name())"/>
<xsl:variable name="elementLocalName" select="string($context/local-name())"/>
<xsl:variable name="messageBase" select="replace(string-join(( 'Datum in het element', $field, 'bij', $elementLocalName, $prGUID, 'ligt niet voor'), ' '), ' ', ' ')"/>
<xsl:variable name="value" select="xsi:dateTime($context/*[local-name()=$field])"/>
<xsl:variable name="value" select="$context/*[local-name()=$field]"/>
<xsl:variable name="valueDate">
<xsl:choose>
<xsl:when test="($value castable as xsi:date)">
<xsl:copy-of select="xsi:date($value)"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="xsi:dateTime($value)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="checkDate">
<xsl:choose>
<xsl:when test="$date='current'">
<xsl:value-of select="current-dateTime()"/>
</xsl:when>
<xsl:when test="contains($date, '-')">
<xsl:when test="contains($date, '-') and ($date castable as xsi:dateTime)">
<xsl:copy-of select="xsi:dateTime($date)"/>
</xsl:when>
<xsl:when test="contains($date, '-') and ($date castable as xsi:date)">
<xsl:copy-of select="xsi:date($date)"/>
</xsl:when>
<xsl:when test="($context/*[local-name()=$date] castable as xsi:date)">
<xsl:copy-of select="xsi:date($context/*[local-name()=$date])"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="xsi:dateTime($context/*[local-name()=$date])"/>
</xsl:otherwise>
Expand All @@ -476,7 +492,7 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$value &gt;= $checkDate">
<xsl:if test="$valueDate &gt;= $checkDate">
<xsl:copy-of select="sikb:createRecord($errorType, $elementName, $message)"/>
</xsl:if>
</xsl:function>
Expand All @@ -489,15 +505,31 @@
<xsl:variable name="elementName" select="string($context/name())"/>
<xsl:variable name="elementLocalName" select="string($context/local-name())"/>
<xsl:variable name="messageBase" select="replace(string-join(( 'Datum in het element', $field, 'bij', $elementLocalName, $prGUID, 'ligt niet na'), ' '), ' ', ' ')"/>
<xsl:variable name="value" select="xsi:dateTime($context/*[local-name()=$field])"/>
<xsl:variable name="value" select="$context/*[local-name()=$field]"/>
<xsl:variable name="valueDate">
<xsl:choose>
<xsl:when test="($value castable as xsi:date)">
<xsl:copy-of select="xsi:date($value)"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="xsi:dateTime($value)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="checkDate">
<xsl:choose>
<xsl:when test="$date='current'">
<xsl:value-of select="current-dateTime()"/>
</xsl:when>
<xsl:when test="contains($date, '-')">
<xsl:when test="contains($date, '-') and ($date castable as xsi:dateTime)">
<xsl:copy-of select="xsi:dateTime($date)"/>
</xsl:when>
<xsl:when test="contains($date, '-') and ($date castable as xsi:date)">
<xsl:copy-of select="xsi:date($date)"/>
</xsl:when>
<xsl:when test="($context/*[local-name()=$date] castable as xsi:date)">
<xsl:copy-of select="xsi:date($context/*[local-name()=$date])"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="xsi:dateTime($context/*[local-name()=$date])"/>
</xsl:otherwise>
Expand All @@ -516,7 +548,7 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$value &lt;= $checkDate">
<xsl:if test="$valueDate &lt;= $checkDate">
<xsl:copy-of select="sikb:createRecord($errorType, $elementName, $message)"/>
</xsl:if>
</xsl:function>
Expand Down

0 comments on commit 05e65c2

Please sign in to comment.