Hi,
I found an issue with test case ad-as.b.1 that fails even though the data is correct.
Problem
Test case ad-as.b.1: An address shall have an admin unit address component spatial object whose level is 1 (Country) fails when validating GML data that correctly contains AdminUnitName components with level 1stOrder (Country).
What's happening
In the test case (line 358 in ets-ad-as-bsxets.xml), the XPath expression uses:
if ($element/ad3:level/text()='1stOrder' or $element/ad:level/@xlink:href='http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/1stOrder') then
The main problems are:
- Incorrect namespace prefix: It uses
ad3:level but the GML uses ad:level (the ad3: prefix doesn't match the actual namespace prefix in the GML data)
- Incorrect value check: It looks for text content in the
level element (/text()='1stOrder'), but level is of type gml:ReferenceType which cannot have textual content according to the schema. The value should be checked via the xlink:href attribute only, which contains the unique identifier URI (http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/1stOrder)
Example data
In the attached ZIP file, you'll find XML files:
ad_Address.xml - contains Address objects with component references
ad_AdminUnitName.xml - contains AdminUnitName objects with level elements
Example Address object:
<ad:Address gml:id="Address.2178420683">
...
<ad:component xlink:href="#AdminUnitName.2183871399"/>
...
</ad:Address>
Example AdminUnitName object with level 1stOrder:
<ad:AdminUnitName gml:id="AdminUnitName.2183871399">
...
<ad:level xlink:href="http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/1stOrder" xlink:title="1stOrder"/>
...
</ad:AdminUnitName>
Where:
ad: = http://inspire.ec.europa.eu/schemas/ad/4.0 (Addresses namespace)
xlink: = http://www.w3.org/1999/xlink (XLink namespace)
Recommended solution
The XPath expression should:
- Use the correct namespace prefix (
ad: instead of ad3:)
- Check the
xlink:href attribute as the primary way to identify the level value (since level is ReferenceType and cannot have textual content)
if ($element/ad:level/@xlink:href='http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/1stOrder') then
The xlink:href URI is the unique identifier for the level value and should be the primary check, not text content or xlink:title.
Additional information
- We're also attaching the validation test report for reference
- All other test cases in the same test suite pass correctly
Attachments
INSPIRE_Internal_WFS_AD_ad.zip
INSPIRE_Internal_WFS_AD_ad_GML.html
Thanks for looking into this!
Hi,
I found an issue with test case
ad-as.b.1that fails even though the data is correct.Problem
Test case
ad-as.b.1: An address shall have an admin unit address component spatial object whose level is 1 (Country)fails when validating GML data that correctly contains AdminUnitName components with level 1stOrder (Country).What's happening
In the test case (line 358 in
ets-ad-as-bsxets.xml), the XPath expression uses:The main problems are:
ad3:levelbut the GML usesad:level(thead3:prefix doesn't match the actual namespace prefix in the GML data)levelelement (/text()='1stOrder'), butlevelis of typegml:ReferenceTypewhich cannot have textual content according to the schema. The value should be checked via thexlink:hrefattribute only, which contains the unique identifier URI (http://inspire.ec.europa.eu/codelist/AdministrativeHierarchyLevel/1stOrder)Example data
In the attached ZIP file, you'll find XML files:
ad_Address.xml- contains Address objects withcomponentreferencesad_AdminUnitName.xml- contains AdminUnitName objects withlevelelementsExample Address object:
Example AdminUnitName object with level 1stOrder:
Where:
ad:=http://inspire.ec.europa.eu/schemas/ad/4.0(Addresses namespace)xlink:=http://www.w3.org/1999/xlink(XLink namespace)Recommended solution
The XPath expression should:
ad:instead ofad3:)xlink:hrefattribute as the primary way to identify the level value (sincelevelisReferenceTypeand cannot have textual content)The
xlink:hrefURI is the unique identifier for the level value and should be the primary check, not text content orxlink:title.Additional information
Attachments
INSPIRE_Internal_WFS_AD_ad.zip
INSPIRE_Internal_WFS_AD_ad_GML.html
Thanks for looking into this!