1 |
9559
|
tao
|
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en">
|
2 |
|
|
<sch:title>Schematron constraints for GML / ISO 19136</sch:title>
|
3 |
|
|
<sch:ns prefix="sch" uri="http://purl.oclc.org/dsdl/schematron"/>
|
4 |
|
|
<sch:ns prefix="gml" uri="http://www.opengis.net/gml/3.2"/>
|
5 |
|
|
<sch:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
|
6 |
|
|
<sch:pattern>
|
7 |
|
|
<sch:rule context="gml:ValueArray">
|
8 |
|
|
<sch:assert test="not(@codeSpace and @uom)">ValueArray may not carry both a reference to a codeSpace and a uom</sch:assert>
|
9 |
|
|
</sch:rule>
|
10 |
|
|
</sch:pattern>
|
11 |
|
|
<sch:pattern>
|
12 |
|
|
<sch:rule context="gml:ValueArray">
|
13 |
|
|
<sch:assert test="count(gml:valueComponent/*) = count(gml:valueComponent/*[name() = name(../../gml:valueComponent[1]/*[1])])">All components shall be of the same type</sch:assert>
|
14 |
|
|
<sch:assert test="count(gml:valueComponents/*) = count(gml:valueComponents/*[name() = name(../*[1])])">All components shall be of the same type</sch:assert>
|
15 |
|
|
</sch:rule>
|
16 |
|
|
</sch:pattern>
|
17 |
|
|
<sch:pattern>
|
18 |
|
|
<sch:rule context="gml:pos">
|
19 |
|
|
<sch:assert test="not(@srsDimension) or @srsName">The presence of a dimension attribute implies the presence of the srsName attribute.</sch:assert>
|
20 |
|
|
<sch:assert test="not(@axisLabels) or @srsName">The presence of an axisLabels attribute implies the presence of the srsName attribute.</sch:assert>
|
21 |
|
|
<sch:assert test="not(@uomLabels) or @srsName">The presence of an uomLabels attribute implies the presence of the srsName attribute.</sch:assert>
|
22 |
|
|
<sch:assert test="(not(@uomLabels) and not(@axisLabels)) or (@uomLabels and @axisLabels)">The presence of an uomLabels attribute implies the presence of the axisLabels attribute and vice versa.</sch:assert>
|
23 |
|
|
</sch:rule>
|
24 |
|
|
</sch:pattern>
|
25 |
|
|
<sch:pattern>
|
26 |
|
|
<sch:rule context="gml:PolyhedralSurface">
|
27 |
|
|
<sch:assert test="count(gml:patches/*)=count(gml:patches/gml:PolygonPatch)">All patches shall be gml:PolygonPatch elements or an element in the substitution group of gml:PolygonPatch. Note that the test currently does not identify substitutable elements correctly, this will require the use of XPath 2 in the future.</sch:assert>
|
28 |
|
|
</sch:rule>
|
29 |
|
|
</sch:pattern>
|
30 |
|
|
<sch:pattern>
|
31 |
|
|
<sch:rule context="gml:TriangulatedSurface">
|
32 |
|
|
<sch:assert test="count(gml:patches/*)=count(gml:patches/gml:Triangle)">All patches shall be gml:Triangle elements or an element in the substitution group of gml:PolygonPatch. Note that the test currently does not identify substitutable elements correctly, this will require the use of XPath 2 in the future.</sch:assert>
|
33 |
|
|
</sch:rule>
|
34 |
|
|
</sch:pattern>
|
35 |
|
|
<sch:pattern>
|
36 |
|
|
<sch:rule context="gml:abstractStrictAssociationRole">
|
37 |
|
|
<sch:assert test="not(@xlink:href and (*|text()))">Property element may not carry both a reference to an object and contain an object.</sch:assert>
|
38 |
|
|
<sch:assert test="@xlink:href | (*|text())">Property element shall either carry a reference to an object or contain an object.</sch:assert>
|
39 |
|
|
</sch:rule>
|
40 |
|
|
</sch:pattern>
|
41 |
|
|
<sch:pattern>
|
42 |
|
|
<sch:rule context="gml:MultiPointDomain">
|
43 |
|
|
<sch:assert test="count(gml:domainSet/*)=count(gml:domainSet/gml:MultiPoint)">All values in the domain set shall be gml:MultiPoint elements or an element in its substitution group. Note that the test currently does not identify substitutable elements correctly, this will require the use of XPath 2 in the future.</sch:assert>
|
44 |
|
|
</sch:rule>
|
45 |
|
|
</sch:pattern>
|
46 |
|
|
<sch:pattern>
|
47 |
|
|
<sch:rule context="gml:MultiCurveDomain">
|
48 |
|
|
<sch:assert test="count(gml:domainSet/*)=count(gml:domainSet/gml:MultiCurve)">All values in the domain set shall be gml:MultiCurve elements or an element in its substitution group. Note that the test currently does not identify substitutable elements correctly, this will require the use of XPath 2 in the future.</sch:assert>
|
49 |
|
|
</sch:rule>
|
50 |
|
|
</sch:pattern>
|
51 |
|
|
<sch:pattern>
|
52 |
|
|
<sch:rule context="gml:MultiSurfaceDomain">
|
53 |
|
|
<sch:assert test="count(gml:domainSet/*)=count(gml:domainSet/gml:MultiSurface)">All values in the domain set shall be gml:MultiSurface elements or an element in its substitution group. Note that the test currently does not identify substitutable elements correctly, this will require the use of XPath 2 in the future.</sch:assert>
|
54 |
|
|
</sch:rule>
|
55 |
|
|
</sch:pattern>
|
56 |
|
|
<sch:pattern>
|
57 |
|
|
<sch:rule context="gml:MultiSolidDomain">
|
58 |
|
|
<sch:assert test="count(gml:domainSet/*)=count(gml:domainSet/gml:MultiSolid)">All values in the domain set shall be gml:MultiSolid elements or an element in its substitution group. Note that the test currently does not identify substitutable elements correctly, this will require the use of XPath 2 in the future.</sch:assert>
|
59 |
|
|
</sch:rule>
|
60 |
|
|
</sch:pattern>
|
61 |
|
|
<sch:pattern>
|
62 |
|
|
<sch:rule context="gml:GridDomain">
|
63 |
|
|
<sch:assert test="count(gml:domainSet/*)=count(gml:domainSet/gml:Grid)">All values in the domain set shall be gml:Grid elements or an element in its substitution group. Note that the test currently does not identify substitutable elements correctly, this will require the use of XPath 2 in the future.</sch:assert>
|
64 |
|
|
</sch:rule>
|
65 |
|
|
</sch:pattern>
|
66 |
|
|
<sch:pattern>
|
67 |
|
|
<sch:rule context="gml:RectifiedGridDomain">
|
68 |
|
|
<sch:assert test="count(gml:domainSet/*)=count(gml:domainSet/gml:RectifiedGrid)">All values in the domain set shall be gml:RectifiedGrid elements or an element in its substitution group. Note that the test currently does not identify substitutable elements correctly, this will require the use of XPath 2 in the future.</sch:assert>
|
69 |
|
|
</sch:rule>
|
70 |
|
|
</sch:pattern>
|
71 |
|
|
</sch:schema>
|