Skip to content

Commit b05c166

Browse files
committed
xslt upgraded
1 parent 8eae6fd commit b05c166

File tree

8 files changed

+80
-156
lines changed

8 files changed

+80
-156
lines changed

Versie 1.1.0/SAD Uitwisselberichten/Controle XSLT/SIKB_SAD IMBRO.xslt

Lines changed: 22 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
<xsl:apply-templates select="//immetingen:Organization"/>
5555
<xsl:apply-templates select="//imsikb0101:Filter"/>
5656
<xsl:apply-templates select="//immetingen:MeasurementObject"/>
57-
<xsl:apply-templates select="//imsikb0101:Borehole" mode="twee"/>
57+
<xsl:apply-templates select="//imsikb0101:Borehole"/>
5858
<xsl:apply-templates select="//imsikb0101:Layer"/>
59-
<xsl:apply-templates select="//imsikb0101:Sample" mode="twee"/>
59+
<xsl:apply-templates select="//imsikb0101:Sample"/>
6060
<xsl:apply-templates select="//immetingen:Analysis"/>
6161
<xsl:apply-templates select="//immetingen:AnalysisProcess"/>
6262
<xsl:apply-templates select="//imsikb0101:featureMember"/>
@@ -171,42 +171,7 @@
171171
</xsl:if>
172172
</xsl:template>
173173
<!-- Sample -->
174-
<xsl:template match="immetingen:Sample" mode="een">
175-
<xsl:variable name="prGUID" select="@gml:id"/>
176-
<xsl:choose>
177-
<xsl:when test="count(spec:specimenType[fn:lower-case(@xlink:href) = fn:lower-case('urn:immetingen:MonsterType:id:1')]) = 1">
178-
<!-- VELDMONSTER -->
179-
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'name', 'ERROR')"/>
180-
<xsl:copy-of select="sikb:checkFilled(., $prGUID, 'name', 'ERROR')"/>
181-
</xsl:when>
182-
<xsl:otherwise>
183-
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'name', 'ERROR')"/>
184-
<xsl:copy-of select="sikb:checkFilled(., $prGUID, 'name', 'ERROR')"/>
185-
</xsl:otherwise>
186-
</xsl:choose>
187-
<xsl:copy-of select="sikb:checkLength(., $prGUID, 'name', 24, 'ERROR')"/>
188-
189-
<xsl:copy-of select="sikb:checkDateBeforeDate(., $prGUID, 'startTime','current', 'ERROR')"/>
190-
<xsl:copy-of select="sikb:checkDateAfterDate(., $prGUID, 'startTime','1980-01-01T00:00:00.00', 'ERROR')"/>
191-
192-
193-
<!-- alle analysemonster en conclusiemonster voor GROND -->
194-
<xsl:if test="(fn:lower-case(spec:specimenType/@xlink:href) = fn:lower-case('urn:immetingen:MonsterType:id:10')
195-
or fn:lower-case(spec:specimenType/@xlink:href) = fn:lower-case('urn:immetingen:MonsterType:id:12'))
196-
and fn:lower-case(spec:materialClass/@xlink:href) = fn:lower-case('urn:immetingen:compartiment:id:1')">
197-
<!-- Check tov maaiveld -->
198-
<xsl:if test="not(fn:lower-case(immetingen:upperDepth/immetingen:Depth/immetingen:condition) = fn:lower-case('urn:immetingen:Hoedanigheid:id:11')
199-
or fn:lower-case(immetingen:upperDepth/immetingen:Depth/immetingen:condition) = fn:lower-case(''))">
200-
<xsl:copy-of select="sikb:createRecord('WARNING', 'imsikb0101:Sample', string-join(('Bij een grond analysemonster of asbest conclusiemonster mag de Begindiepte alleen t.o.v. Maaiveld zijn.; Sample gml:id =', $prGUID), ' ') )"/>
201-
</xsl:if>
202-
<xsl:if test="not(fn:lower-case(immetingen:lowerDepth/immetingen:Depth/immetingen:condition) = fn:lower-case('urn:immetingen:Hoedanigheid:id:11')
203-
or fn:lower-case(immetingen:lowerDepth/immetingen:Depth/immetingen:condition) = fn:lower-case(''))">
204-
<xsl:copy-of select="sikb:createRecord('WARNING', 'imsikb0101:Sample', string-join(('Bij een grond analysemonster of asbest conclusiemonster mag de Einddiepte alleen t.o.v. Maaiveld zijn.; Sample gml:id =', $prGUID), ' ') )"/>
205-
</xsl:if>
206-
</xsl:if>
207-
208-
</xsl:template>
209-
<xsl:template match="imsikb0101:Sample" mode="twee">
174+
<xsl:template match="imsikb0101:Sample">
210175
<xsl:variable name="prGUID" select="@gml:id"/>
211176

212177
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'specimenType', 'ERROR')"/>
@@ -234,6 +199,13 @@
234199
<xsl:if test="(fn:lower-case(spec:specimenType/@xlink:href) = fn:lower-case('urn:immetingen:MonsterType:id:1')) and not(fn:lower-case(spec:materialClass/@xlink:href) = fn:lower-case('urn:immetingen:compartiment:id:1'))">
235200
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'relatedObservation', 'WARNING')"/>
236201
</xsl:if>
202+
<!-- veldmonsters (wel grond)-->
203+
<xsl:if test="(fn:lower-case(spec:specimenType/@xlink:href) = fn:lower-case('urn:immetingen:MonsterType:id:1')) and fn:lower-case(spec:materialClass/@xlink:href) = fn:lower-case('urn:immetingen:compartiment:id:1')">
204+
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'upperDepth', 'ERROR')"/>
205+
<xsl:copy-of select="sikb:checkFilled(., $prGUID, 'upperDepth', 'ERROR')"/>
206+
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'lowerDepth', 'ERROR')"/>
207+
<xsl:copy-of select="sikb:checkFilled(., $prGUID, 'lowerDepth', 'ERROR')"/>
208+
</xsl:if>
237209
<!-- analysemonsters-->
238210
<xsl:if test="fn:lower-case(spec:specimenType/@xlink:href) = fn:lower-case('urn:immetingen:MonsterType:id:10')">
239211
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'relatedObservation', 'WARNING')"/>
@@ -251,6 +223,10 @@
251223
<xsl:if test="fn:lower-case(spec:specimenType/@xlink:href) = fn:lower-case('urn:immetingen:MonsterType:id:12')">
252224
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'relatedSamplingFeature', 'WARNING')"/>
253225
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'relatedObservation', 'WARNING')"/>
226+
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'upperDepth', 'ERROR')"/>
227+
<xsl:copy-of select="sikb:checkFilled(., $prGUID, 'upperDepth', 'ERROR')"/>
228+
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'lowerDepth', 'ERROR')"/>
229+
<xsl:copy-of select="sikb:checkFilled(., $prGUID, 'lowerDepth', 'ERROR')"/>
254230
</xsl:if>
255231

256232
<xsl:copy-of select="sikb:checkDateBeforeDate(., $prGUID, 'startTime','current', 'ERROR')"/>
@@ -272,34 +248,15 @@
272248
</xsl:if>
273249
</xsl:if>
274250

275-
</xsl:template>
276-
<!-- Analysis-->
277-
<xsl:template match="immetingen:Analysis">
278-
<xsl:variable name="arGUID" select="@gml:id"/>
279-
<xsl:variable select="string(om:result/@*)" name="arType"/>
280-
<xsl:if test="not(contains($arType,'immetingen:AnalyticResultType'))">
281-
<xsl:if test="not(contains($arType,'immetingen:MeasureResultType'))">
282-
<xsl:copy-of select="sikb:createRecord('ERROR', 'imsikb0101:AnalyticResult', string-join(('Er moet een AnalyticResult of MeasureResult in Analysis aanwezig zijn; Analysis gml:id =', $arGUID), ' ') )"/>
283-
</xsl:if>
284-
</xsl:if>
285-
<!-- Check AnalysisProcess -->
286-
<xsl:variable select="replace(om:procedure/@xlink:href, '#', '')" name="prLiGUID"/>
287-
<xsl:variable select="om:procedure/*/@gml:id" name="prInGUID"/>
288-
<xsl:if test="concat($prInGUID, '', $prLiGUID) != ''">
289-
<xsl:if test="count(//immetingen:AnalysisProcess[@gml:id = concat($prInGUID, '', $prLiGUID)]) != 1">
290-
<xsl:copy-of select="sikb:createRecord('ERROR', 'immetingen:AnalysisProcess', string-join(('Analysis verwijst niet naar procedure van type: AnalysisProcess; Analysis gml:id =', $arGUID), ' ') )"/>
291-
</xsl:if>
292-
</xsl:if>
293-
<xsl:copy-of select="sikb:checkLookupId(., $arGUID, 'parameter', 'Parameter', 'WARNING')"/>
294-
</xsl:template>
251+
</xsl:template>
295252
<!-- Analysis Process-->
296253
<xsl:template match="immetingen:AnalysisProcess">
297254
<xsl:variable name="arpGUID" select="@gml:id"/>
298255
<xsl:copy-of select="sikb:checkLookupId(., $arpGUID, 'analyticalTechnique', 'Waardebepalingstechniek', 'WARNING')"/>
299256
<xsl:copy-of select="sikb:checkLookupId(., $arpGUID, 'valuationMethod', 'Waardebepalingsmethode', 'WARNING')"/>
300257
</xsl:template>
301258
<!-- Borehole -->
302-
<xsl:template match="imsikb0101:Borehole" mode="twee">
259+
<xsl:template match="imsikb0101:Borehole">
303260
<xsl:variable name="prGUID" select="@gml:id"/>
304261
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'name', 'ERROR')"/>
305262
<xsl:copy-of select="sikb:checkFilled(., $prGUID, 'name', 'ERROR')"/>
@@ -405,7 +362,9 @@
405362
<xsl:copy-of select="sikb:checkFilled(., $prGUID, 'name', 'ERROR')"/>
406363
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'startTime', 'WARNING')"/>
407364
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'upperDepth', 'ERROR')"/>
365+
<xsl:copy-of select="sikb:checkFilled(., $prGUID, 'upperDepth', 'ERROR')"/>
408366
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'lowerDepth', 'ERROR')"/>
367+
<xsl:copy-of select="sikb:checkFilled(., $prGUID, 'lowerDepth', 'ERROR')"/>
409368
<xsl:copy-of select="sikb:checkLength(., $prGUID, 'name', 24, 'ERROR')"/>
410369
</xsl:template>
411370
<xsl:template match="imsikb0101:geometry">
@@ -430,6 +389,7 @@
430389
</xsl:otherwise>
431390
</xsl:choose>
432391
</xsl:template>
392+
<!-- Analysis-->
433393
<xsl:template match="immetingen:Analysis">
434394
<xsl:variable name="arGUID" select="@gml:id"/>
435395
<xsl:variable select="string(om:result/@*)" name="arType"/>
@@ -482,10 +442,12 @@
482442
</xsl:if>
483443
</xsl:if>
484444

445+
<xsl:apply-templates select="./immetingen:physicalProperty/immetingen:PhysicalProperty"/>
485446
<xsl:copy-of select="sikb:checkLookupId(./om:result, 'analyseResultaat', 'valueProcessingMethod', 'Waardebewerkingsmethode', 'WARNING')"/>
486447
</xsl:template>
487448
<xsl:template match="immetingen:PhysicalProperty">
488449
<xsl:copy-of select="sikb:checkExistence(., 'analyseResultaat', 'quantity', 'ERROR')"/>
450+
<xsl:copy-of select="sikb:checkFilled(., 'analyseResultaat', 'quantity', 'ERROR')"/>
489451
<!-- check nog aanpassen in verband met check op attribuut ipv element -->
490452
<xsl:copy-of select="sikb:checkLookupId(., 'analyseResultaat', 'quantity', 'Parameter', 'WARNING')"/>
491453
<xsl:copy-of select="sikb:checkLookupId(., 'analyseResultaat', 'parameter', 'Parameter', 'WARNING')"/>
@@ -867,7 +829,7 @@
867829
</xsl:if>
868830
</xsl:when>
869831
<xsl:when test="$checkCorrectTable = '0'">
870-
<xsl:variable name="wrongTable" select="replace(string-join(('Verwijzing naar LookupTabel {',$lookupCategory,' } van het element', $field, 'bij', $elementLocalName, $prGUID, 'moet verwijzen naar LookupTabel {', $CategoryElement,'} in de lookup-files.'), ' '), ' ', ' ')"/>
832+
<xsl:variable name="wrongTable" select="replace(string-join(('Verwijzing naar LookupTabel {',$lookupCategory,' } (', $lookupValue ,') van het element', $field, 'bij', $elementLocalName, $prGUID, 'moet verwijzen naar LookupTabel {', $CategoryElement,'} in de lookup-files.'), ' '), ' ', ' ')"/>
871833
<xsl:copy-of select="sikb:createRecord('ERROR', $elementName, $wrongTable)"/>
872834
</xsl:when>
873835
</xsl:choose>

0 commit comments

Comments
 (0)