Skip to content

Commit

Permalink
Merge pull request #45 from inspire-eu-validation/cp
Browse files Browse the repository at this point in the history
Fix for #44
  • Loading branch information
cportele authored Mar 22, 2017
2 parents f3c8bdf + 27df53c commit 194b84d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions testquery-noggeo.xq
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,11 @@ declare function local:testDesignationConstraint($features3 as element()*, $feat
let $allowedValuesURI := local:getAllowedValuesURI( 'http://inspire.ec.europa.eu/codelist/' || $codelist )
let $allowedValuesCode := local:getAllowedValuesCode( $allowedValuesURI, $codelist )
let $valuesCode := fn:distinct-values($features3/ps3:siteDesignation/*[ps3:designationScheme=$scheme]/ps3:designation/text())
let $valuesURI := fn:distinct-values($features4/ps:siteDesignation/*[ps:designationScheme=concat('http://inspire.ec.europa.eu/codelist/DesignationSchemeValue/',$scheme)]/ps:designation/@xlink:href)
let $valuesURI := fn:distinct-values($features4/ps:siteDesignation/*[ps:designationScheme/@xlink:href=concat('http://inspire.ec.europa.eu/codelist/DesignationSchemeValue/',$scheme)]/ps:designation/@xlink:href)
let $badvaluesCode := functx:value-except($valuesCode,$allowedValuesCode)
let $badvaluesURI := functx:value-except($valuesURI,$allowedValuesURI)
let $featuresWithErrors3 := $features3[ps3:siteDesignation/*[ps3:designationScheme=$scheme]/ps3:designation/text()=$badvaluesCode]
let $featuresWithErrors4 := $features4[ps:siteDesignation/*[ps:designationScheme=$scheme]/ps:designation/@xlink:href=$badvaluesURI]
let $featuresWithErrors4 := $features4[ps:siteDesignation/*[ps:designationScheme/@xlink:href=concat('http://inspire.ec.europa.eu/codelist/DesignationSchemeValue/',$scheme)]/ps:designation/@xlink:href=$badvaluesURI]
return
(for $feature in $featuresWithErrors3
order by $feature/@gml:id
Expand All @@ -427,7 +427,7 @@ return
local:addMessage('TR.constraintViolation', map { 'filename': local:filename($feature), 'featureType': local-name($feature), 'gmlid': string($feature/@gml:id), 'constraint': 'Sites must use designations from an appropriate designation scheme.', 'additionalInfo': 'For designation scheme ''' || $scheme || ''' the following disallowed value(s) have been used: ' || string-join($values,', ') || '. Allowed values are: ' || string-join($allowedValuesCode,', ') || '.' }),
for $feature in $featuresWithErrors4
order by $feature/@gml:id
let $values := $feature/ps:siteDesignation/*[ps:designationScheme=$scheme]/ps:designation/@xlink:href[.=$badvaluesURI]
let $values := $feature/ps:siteDesignation/*[ps:designationScheme/@xlink:href=concat('http://inspire.ec.europa.eu/codelist/DesignationSchemeValue/',$scheme)]/ps:designation/@xlink:href[.=$badvaluesURI]
return
local:addMessage('TR.constraintViolation', map { 'filename': local:filename($feature), 'featureType': local-name($feature), 'gmlid': string($feature/@gml:id), 'constraint': 'Sites must use designations from an appropriate designation scheme.', 'additionalInfo': 'For designation scheme ''' || $scheme || ''' the following disallowed value(s) have been used: ' || string-join($values,', ') || '. Allowed values are: ' || string-join($allowedValuesURI,', ') || '.' }))
};
Expand Down

0 comments on commit 194b84d

Please sign in to comment.