<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
    <ns prefix="gml" uri="http://www.opengis.net/gml"/>
    <ns prefix="bldg" uri="http://www.opengis.net/citygml/building/2.0"/>
    
    <pattern>
        <rule context="//*:Building">
            <assert test="count(*:lod2Solid) = 1"><value-of select="@gml:id | @id"/>||||SE_ATTRIBUTE_MISSING||lod1Solid||false</assert>
            <assert test="count(*:yearOfConstruction) &gt;= 1"><value-of select="@gml:id | @id"/>||||SE_ATTRIBUTE_MISSING||yearOfConstruction||false</assert>
            <assert test="count(*:function) = 1"><value-of select="@gml:id | @id"/>||||SE_ATTRIBUTE_MISSING||function||false</assert>
			<assert test="*:doubleAttribute[@name = 'Volume'] &gt; 0 and *:doubleAttribute[@name = 'Volume'] &lt; 5000"><value-of select="@gml:id | @id"/>||||SE_ATTRIBUTE_WRONG_VALUE||volume||true</assert>
        </rule>
		<rule context="//*:Building//*:RoofSurface">
            <assert test="count(function) = 1"><value-of select="ancestor::*:Building/@*:id"/>||<value-of select="@gml:id | @id"/>||SE_ATTRIBUTE_MISSING||function||false</assert>
		</rule>
    </pattern>
</schema> 
