All Downloads are FREE. Search and download functionalities are using the official Maven repository.

wfs.1.1.0.ctl.wfs-transaction.Transaction.Transaction-XML.xml Maven / Gradle / Ivy

Go to download

Verifies conformance of implementations to the OGC Web Feature Service (WFS 1.1.0)Standard.

The newest version!
<?xml version="1.0" encoding="UTF-8"?>
<ctl:package xmlns="http://www.occamlab.com/ctl"
             xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
             xmlns:ctl="http://www.occamlab.com/ctl"
             xmlns:parsers="http://www.occamlab.com/te/parsers"
             xmlns:p="http://teamengine.sourceforge.net/parsers"
             xmlns:saxon="http://saxon.sf.net/"
             xmlns:wfs="http://www.opengis.net/wfs"
             xmlns:ows="http://www.opengis.net/ows"
             xmlns:ogc="http://www.opengis.net/ogc"
             xmlns:gml="http://www.opengis.net/gml"
             xmlns:xlink="http://www.w3.org/1999/xlink"
             xmlns:xi="http://www.w3.org/2001/XInclude"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:sf="http://cite.opengeospatial.org/gmlsf">

    <!-- Include the cleanup (delete) group -->
    <xi:include href="./Transaction-Cleanup.xml"/>

    <!-- include test groups for optional capabilities (GMLSF level 1) -->
    <xi:include href="gmlsf-1/Transaction-XML-gmlsf1.xml"/>

    <ctl:test name="wfs:run-Transaction-POST">
        <ctl:param name="wfs.GetCapabilities.document" />
        <ctl:param name="gmlsf.level" />
        <ctl:param name="supports.atomic.trx" />
        <ctl:assertion>Run test group for Transaction requests using the POST method</ctl:assertion>
        <ctl:code>

            <ctl:call-test name="wfs:Transaction-invalid-lock">
                <ctl:with-param name="CAPABILITIES" select="$wfs.GetCapabilities.document" />
            </ctl:call-test>
            <xsl:variable name="idgen-supported" select="boolean($wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='Transaction']/ows:Parameter[@name='idgen'])"/>
                
            <xsl:if test="$idgen-supported">
                <ctl:call-test name="wfs:Transaction-idgen-generate-new">
                    <ctl:with-param name="CAPABILITIES" select="$wfs.GetCapabilities.document" />
                </ctl:call-test>
                <ctl:call-test name="wfs:Transaction-idgen-use-existing">
                    <ctl:with-param name="CAPABILITIES" select="$wfs.GetCapabilities.document" />
                </ctl:call-test>
                <ctl:call-test name="wfs:Transaction-idgen-use-existing-update">
                    <ctl:with-param name="CAPABILITIES" select="$wfs.GetCapabilities.document" />
                </ctl:call-test>
            </xsl:if>
                
            <xsl:variable name="wfs.Transaction.post.url">
                <xsl:value-of select="$wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='Transaction']/ows:DCP/ows:HTTP/ows:Post/@xlink:href"/>
            </xsl:variable>
            <xsl:variable name="wfs.GetFeature.get.url">
                <xsl:value-of select="$wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='GetFeature']/ows:DCP/ows:HTTP/ows:Get/@xlink:href"/>
            </xsl:variable>
            <xsl:variable name="wfs.GetFeature.post.url">
                <xsl:value-of select="$wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='GetFeature']/ows:DCP/ows:HTTP/ows:Post/@xlink:href"/>
            </xsl:variable>
            <xsl:variable name="wfs.GetFeatureWithLock" select="boolean($wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='GetFeatureWithLock'])"/>
            <xsl:variable name="wfs.LockFeature" select="boolean($wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='LockFeature'])"/>
            <xsl:variable name="idgen.UseExisting" select="$wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='Transaction']/ows:Parameter[@name='Idgen']//ows:Value = 'UseExisting'"/>
            <ctl:message>Target endpoint is <xsl:value-of select="$wfs.Transaction.post.url"/></ctl:message>

            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc1.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
                <ctl:with-param name="wfs.GetFeature.get.url" select="$wfs.GetFeature.get.url"/>
		<ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
		<ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc2.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
                <ctl:with-param name="wfs.GetFeature.get.url" select="$wfs.GetFeature.get.url"/>
		<ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
		<ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc2.2">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc3.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
                <ctl:with-param name="wfs.GetFeature.get.url" select="$wfs.GetFeature.get.url"/>
                <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
                <ctl:with-param name="supports.atomic.trx" select="$supports.atomic.trx"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc4.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
                <ctl:with-param name="wfs.GetFeature.get.url" select="$wfs.GetFeature.get.url"/>
                <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
		<ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc5.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
                <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc6.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc7.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
                <ctl:with-param name="wfs.GetFeature.get.url" select="$wfs.GetFeature.get.url"/>
                <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
		<ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc7.2">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc8.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
                <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc9.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
                <ctl:with-param name="wfs.GetFeature.get.url" select="$wfs.GetFeature.get.url"/>
		<ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
                <ctl:with-param name="supports.atomic.trx" select="$supports.atomic.trx"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc10.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
                <ctl:with-param name="supports.atomic.trx" select="$supports.atomic.trx"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc11.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
                <ctl:with-param name="wfs.GetFeature.get.url" select="$wfs.GetFeature.get.url"/>
                <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
                <ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc12.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
            </ctl:call-test>
            <ctl:call-test name="wfs:wfs-1.1.0-Transaction-tc13.1">
                <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
                <ctl:with-param name="wfs.GetFeature.get.url" select="$wfs.GetFeature.get.url"/>
                <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
                <ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document"/>
            </ctl:call-test>

            <xsl:if test="$gmlsf.level = 'sf-1'">
                <ctl:call-test name="wfs:run-Transaction-XML-gmlsf1">
                    <ctl:with-param name="wfs.Transaction.post.url" select="$wfs.Transaction.post.url"/>
                    <ctl:with-param name="wfs.GetFeature.get.url" select="$wfs.GetFeature.get.url"/>
                </ctl:call-test>
            </xsl:if>
            <xsl:if test="idgen.UseExisting">
                <ctl:message>User-assigned gml:id values are supported.</ctl:message>
            </xsl:if>

            <!-- Cleanup the inserted features -->
            <ctl:call-test name="wfs:run-Transaction-Cleanup">
                <ctl:with-param name="wfs.GetCapabilities.document" select="$wfs.GetCapabilities.document"/>
                <ctl:with-param name="gmlsf.level" select="$gmlsf.level"/>
            </ctl:call-test>

        </ctl:code>
    </ctl:test>

    <test name="wfs:wfs-1.1.0-Transaction-tc1.1">
        <param name="wfs.Transaction.post.url"/>
        <param name="wfs.GetFeature.get.url"/>
        <param name="wfs.GetFeature.post.url"/>
	<ctl:param name="wfs.GetCapabilities.document" />
        <assertion>
            The response to a transaction request containing an insert statement must
            include a listing of identifiers for all successfully inserted features.
        </assertion>
        <comment>Pass if all of the following conditions are true: (1) the response
            is schema valid; (2) TransactionSummary/totalInserted = 3; and (3) the
            wfs:InsertResults element has three child wfs:Feature elements.</comment>
        <link>wfs-1.1.0-Transaction-atc1</link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc1.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1/>
                </request>
            </xsl:variable>

            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="totalInserted" select="$response//wfs:totalInserted" />
                    <ctl:call-test name="ctl:SchematronValidatingParser">
                        <ctl:with-param name="doc" select="$response" />
                        <ctl:with-param name="schema">/sch/wfs/1.1.0/Transaction.sch</ctl:with-param>
                        <ctl:with-param name="phase">DefaultPhase</ctl:with-param>
                    </ctl:call-test>
                    <xsl:if test="$totalInserted != 3">
                        <ctl:message>FAILURE: Expected totalInserted = 3 (reported total is <xsl:value-of select="$totalInserted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
		  <xsl:choose>
                    <xsl:when test="$wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='GetFeature']/ows:DCP/ows:HTTP/ows:Get/@xlink:href">                    
	              <xsl:for-each select="$response//wfs:InsertResults/wfs:Feature/ogc:FeatureId">
                        <ctl:call-test name="wfs:GetFeatureById-KVP">
                            <ctl:with-param name="wfs.GetFeature.get.url" select="$wfs.GetFeature.get.url"/>
                            <ctl:with-param name="id" select="./@fid"/>
                            <ctl:with-param name="empty.response" select="'false'" />
                        </ctl:call-test>
                      </xsl:for-each>
		    </xsl:when>
	            <xsl:otherwise>
		      <xsl:for-each select="$response//wfs:InsertResults/wfs:Feature/ogc:FeatureId">
                        <ctl:call-test name="wfs:GetFeatureByName">
                          <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
                          <ctl:with-param name="type" select="$response//gml:featureMembers/*"/>
                          <ctl:with-param name="name.value" select="./gml:name" />
                          <ctl:with-param name="empty.response" select="'true'" />
                        </ctl:call-test>
                      </xsl:for-each>
		    </xsl:otherwise>
		  </xsl:choose>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc2.1">
        <param name="wfs.Transaction.post.url"/>
        <param name="wfs.GetFeature.get.url"/>
        <param name="wfs.GetFeature.post.url"/>
	<ctl:param name="wfs.GetCapabilities.document" />
        <assertion>
            The global srsName attribute must be applied to all submitted geometries
            which do not specify an alternative supported CRS.
        </assertion>
        <comment>Pass if all of the following conditions are true: (1) the response
            is schema valid; (2) TransactionSummary/totalInserted = 1; and (3) the
            wfs:InsertResults element has one child wfs:Feature element.</comment>
        <link>wfs-1.1.0-Transaction-atc2</link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc2.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1/>
                </request>
            </xsl:variable>

            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <ctl:call-test name="ctl:SchematronValidatingParser">
                        <ctl:with-param name="doc" select="$response" />
                        <ctl:with-param name="schema">/sch/wfs/1.1.0/Transaction.sch</ctl:with-param>
                        <ctl:with-param name="phase">DefaultPhase</ctl:with-param>
                    </ctl:call-test>
                    <xsl:variable name="totalInserted" select="$response//wfs:totalInserted" />
                    <xsl:if test="$totalInserted != 1">
                        <ctl:message>FAILURE: Expected totalInserted = 1 (reported total is <xsl:value-of select="$totalInserted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
		    <xsl:choose>
		    <xsl:when test="$wfs.GetCapabilities.document//ows:OperationsMetadata/ows:Operation[@name='GetFeature']/ows:DCP/ows:HTTP/ows:Get/@xlink:href"> 
                    <ctl:call-test name="wfs:GetFeatureById-KVP">
                        <ctl:with-param name="wfs.GetFeature.get.url" select="$wfs.GetFeature.get.url"/>
                        <ctl:with-param name="id" select="$response//wfs:InsertResults/wfs:Feature[1]/ogc:FeatureId/@fid"/>
                        <ctl:with-param name="empty.response" select="'false'" />
                    </ctl:call-test>
		    </xsl:when>
	            <xsl:otherwise>
		    <ctl:call-test name="wfs:GetFeatureByName">
                        <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
                        <ctl:with-param name="type" select="$response//gml:featureMembers/*[1]"/>
                        <ctl:with-param name="name.value" select="./gml:name" />
                        <ctl:with-param name="empty.response" select="'true'" />
                    </ctl:call-test>
		    </xsl:otherwise>
		  </xsl:choose>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc2.2">
        <param name="wfs.Transaction.post.url"/>
        <assertion>
            The response to a Transaction request that specifies an unsupported Insert/srsName
            value must include an exception report.
        </assertion>
        <comment>Pass if all of the following conditions are true: (1) the response
            is a valid ows:ExceptionReport; (2) the reported exceptionCode is "InvalidParameterValuePhase".
        </comment>
        <link>wfs-1.1.0-Transaction-atc2</link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc2.2.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.OWS />
                </request>
            </xsl:variable>

            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <ctl:call-test name="ctl:SchematronValidatingParser">
                        <ctl:with-param name="doc" select="$response" />
                        <ctl:with-param name="schema">/sch/ows/1.0.0/ExceptionReport.sch</ctl:with-param>
                        <ctl:with-param name="phase">InvalidParameterValuePhase</ctl:with-param>
                    </ctl:call-test>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc3.1">
        <param name="wfs.Transaction.post.url"/>
        <param name="wfs.GetFeature.get.url"/>
        <param name="wfs.GetFeature.post.url"/>
        <ctl:param name="supports.atomic.trx" />
        <assertion>
            Insert statements containing features having a geometry value in an unsupported
            CRS shall be skipped if atomic transactions are not supported. Otherwise the
            transaction must fail and an exception report is generated.
        </assertion>
        <comment>Pass if the features contained in failing insert statements are
            not inserted. The response must satify either of the following cases:
            (1) it includes a valid ows:ExceptionReport;
            (2) it includes a wfs:TransactionResponse/wfs:TransactionResults element
            indicating the failing statement.
        </comment>
        <link></link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc3.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1 />
                </request>
            </xsl:variable>
            <xsl:variable name="docElement" select="local-name($response/*[1])" />
            <xsl:choose>
                <xsl:when test="not($supports.atomic.trx)">
                    <ctl:call-test name="ctl:SchematronValidatingParser">
                        <ctl:with-param name="doc" select="$response" />
                        <ctl:with-param name="schema">/sch/wfs/1.1.0/Transaction.sch</ctl:with-param>
                        <ctl:with-param name="phase">DefaultPhase</ctl:with-param>
                    </ctl:call-test>
                    <xsl:if test="count($response//wfs:InsertResults/*) != 1">
                        <ctl:message>FAILURE: Expected wfs:InsertResults to have 1 child element</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <xsl:if test="$response//wfs:TransactionResults/wfs:Action/@locator != 'insert-1'">
                        <ctl:message>FAILURE: Expected wfs:Action/@locator = 'insert-1'</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <ctl:call-test name="wfs:GetFeatureByName">
                        <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
                        <ctl:with-param name="type" select="'sf:EntitéGénérique'"/>
                        <ctl:with-param name="name.value" select="'cite.gmlsf0-f06'" />
                        <ctl:with-param name="empty.response" select="'true'" />
                    </ctl:call-test>
                </xsl:when>
                <xsl:otherwise>
                    <ctl:call-test name="ctl:SchematronValidatingParser">
                        <ctl:with-param name="doc" select="$response" />
                        <ctl:with-param name="schema">/sch/ows/1.0.0/ExceptionReport.sch</ctl:with-param>
                        <ctl:with-param name="phase">DefaultPhase</ctl:with-param>
                    </ctl:call-test>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc4.1">
        <param name="wfs.Transaction.post.url"/>
        <param name="wfs.GetFeature.get.url"/>
        <param name="wfs.GetFeature.post.url"/>
	<ctl:param name="wfs.GetCapabilities.document" />
        <assertion>
            Transaction statements must be processed in document order.
        </assertion>
        <comment>Pass if the insert, update, and delete statements are processed
            in the correct order. The response message must report that one feature
            was inserted, one was deleted, and none were updated.
        </comment>
        <link>wfs-1.1.0-Transaction-atc4</link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc4.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1 />
                </request>
            </xsl:variable>

                    <ctl:call-test name="ctl:SchematronValidatingParser">
                        <ctl:with-param name="doc" select="$response" />
                        <ctl:with-param name="schema">/sch/wfs/1.1.0/Transaction.sch</ctl:with-param>
                        <ctl:with-param name="phase">DefaultPhase</ctl:with-param>
                    </ctl:call-test>
                    <xsl:variable name="totalInserted" select="$response//wfs:totalInserted" />
                    <xsl:if test="$totalInserted != 1">
                        <ctl:message>FAILURE: Expected totalInserted = 1 (reported total is <xsl:value-of select="$totalInserted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <xsl:variable name="totalUpdated" select="$response//wfs:totalUpdated" />
                    <xsl:if test="$totalUpdated != 0">
                        <ctl:message>FAILURE: Expected totalUpdated = 0 (reported total is <xsl:value-of select="$totalUpdated"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <xsl:variable name="totalDeleted" select="$response//wfs:totalDeleted" />
                    <xsl:if test="$totalDeleted != 1">
                        <ctl:message>FAILURE: Expected totalDeleted = 1 (reported total is <xsl:value-of select="$totalDeleted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc5.1">
        <param name="wfs.Transaction.post.url"/>
        <param name="wfs.GetFeature.post.url"/>
        <assertion>
            The response to a Transaction request containing one or more update statements
            must report how many features were updated.
        </assertion>
        <comment>
            Pass if the update statements are processed correctly. The response message
            must report that one feature was inserted and one was updated.
        </comment>
        <link>wfs-1.1.0-Transaction-atc5</link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc5.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1 />
                </request>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="totalInserted" select="$response//wfs:totalInserted" />
                    <xsl:if test="$totalInserted != 1">
                        <ctl:message>FAILURE: Expected totalInserted = 1 (reported total is <xsl:value-of select="$totalInserted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <xsl:variable name="totalUpdated" select="$response//wfs:totalUpdated" />
                    <xsl:if test="$totalUpdated != 1">
                        <ctl:message>FAILURE: Expected totalUpdated = 1 (reported total is <xsl:value-of select="$totalUpdated"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <ctl:call-test name="wfs:GetFeatureByName">
                        <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
                        <ctl:with-param name="type" select="'sf:AggregateGeoFeature'"/>
                        <ctl:with-param name="name.value" select="'cite.gmlsf0-f26bis'" />
                        <ctl:with-param name="empty.response" select="'false'" />
                    </ctl:call-test>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc6.1">
        <param name="wfs.Transaction.post.url"/>
        <assertion>
            The response to a wfs:Native statement in which safeToIgnore="false" must
            include an exception report.
        </assertion>
        <comment>Pass if all of the following conditions are true: (1) the response
            is a valid ows:ExceptionReport; (2) the reported exceptionCode is "InvalidParameterValuePhase".
        </comment>
        <ctl:link>wfs-1.1.0-Transaction-atc1</ctl:link>
        <ctl:link>OGC 04-094, 7.5, p.22</ctl:link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc6.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.OWS />
                </request>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <ctl:call-test name="ctl:SchematronValidatingParser">
                        <ctl:with-param name="doc" select="$response" />
                        <ctl:with-param name="schema">/sch/ows/1.0.0/ExceptionReport.sch</ctl:with-param>
                        <ctl:with-param name="phase">InvalidParameterValuePhase</ctl:with-param>
                    </ctl:call-test>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc7.1">
        <param name="wfs.Transaction.post.url"/>
        <param name="wfs.GetFeature.post.url"/>
        <assertion>
            The response to a Transaction request that updates a complex property
            value must report how many features were updated.
        </assertion>
        <comment>
            Pass if the update statement modifying a geometry property is processed
            correctly. The response message must report that one feature was inserted
            and one was updated.
        </comment>
        <link>wfs-1.1.0-Transaction-atc5</link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc7.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1 />
                </request>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="totalInserted" select="$response//wfs:totalInserted" />
                    <xsl:if test="$totalInserted != 1">
                        <ctl:message>FAILURE: Expected totalInserted = 1 (reported total is <xsl:value-of select="$totalInserted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <xsl:variable name="totalUpdated" select="$response//wfs:totalUpdated" />
                    <xsl:if test="$totalUpdated != 1">
                        <ctl:message>FAILURE: Expected totalUpdated = 1 (reported total is <xsl:value-of select="$totalUpdated"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <!-- Confirm that geometry property was updated -->
                    <xsl:variable name="fid">
                        <xsl:value-of select="$response//wfs:InsertResults/wfs:Feature[1]/ogc:FeatureId/@fid"/>
                    </xsl:variable>
                    <xsl:variable name="response2">
                        <request>
                    <url>
                        <xsl:value-of select="$wfs.GetFeature.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc7.1-2.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1/>
                </request>
                    </xsl:variable>
                    <xsl:if test="local-name($response2//sf:attribut.Géométrie/*) != 'MultiSurface'">
                        <ctl:message>FAILURE: Expected geometry value is gml:MultiSurface (feature gml:id="<xsl:value-of select="$fid"/>")</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc7.2">
        <param name="wfs.Transaction.post.url"/>
        <assertion>
            The response to a Transaction/Update request that attempts to update a
            geometry property having coordinates that do not correspond to the default
            CRS shall report a failing update statement.
        </assertion>
        <comment>
            Pass if the wfs:TransactionResults/wfs:Action element in the response
            refers the failing insert statement.
        </comment>
        <link>wfs-1.1.0-Transaction-atc6</link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc7.2.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1/>
                </request>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="totalInserted" select="$response//wfs:totalInserted" />
                    <xsl:if test="$totalInserted != 1">
                        <ctl:message>FAILURE: Expected totalInserted = 1 (reported total is <xsl:value-of select="$totalInserted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <xsl:variable name="totalUpdated" select="$response//wfs:totalUpdated" />
                    <xsl:if test="$totalUpdated != 0">
                        <ctl:message>FAILURE: Expected totalUpdated = 0 (reported total is <xsl:value-of select="$totalUpdated"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <!-- Confirm that update statement failed -->
                    <xsl:if test="$response//wfs:TransactionResults/wfs:Action/@locator != 'upd-1'">
                        <ctl:message>FAILURE: Expected wfs:Action/@locator = 'upd-1'</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc8.1">
        <param name="wfs.Transaction.post.url"/>
        <param name="wfs.GetFeature.post.url" />
        <assertion>
            Update multiple properties.
        </assertion>
        <comment>
            Pass if all properties are successfully updated.
        </comment>
        <link>wfs-1.1.0-Transaction-atc6</link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc8.1.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1/>
                </request>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="totalInserted" select="$response//wfs:totalInserted" />
                    <xsl:if test="$totalInserted != 1">
                        <ctl:message>FAILURE: Expected totalInserted = 1 (reported total is <xsl:value-of select="$totalInserted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <!-- Submit update request -->
                    <xsl:variable name="fid">
                        <xsl:value-of select="$response//wfs:InsertResults/wfs:Feature[1]/ogc:FeatureId/@fid"/>
                    </xsl:variable>
                    <xsl:variable name="response2">
                        <request>
                            <url>
                                <xsl:value-of select="$wfs.Transaction.post.url"/>
                            </url>
                            <method>POST</method>
                            <body>
                                <xi:include href="./wfs-1.1.0-Transaction-tc8.1.2.body.xml"/>
                            </body>
                            <p:XMLValidatingParser.GMLSF1 />
                        </request>
                    </xsl:variable>
                    <xsl:variable name="totalUpdated" select="$response2//wfs:totalUpdated" />
                    <xsl:if test="$totalUpdated != 1">
                        <ctl:message>FAILURE: Expected totalUpdated = 1 (reported total is <xsl:value-of select="$totalUpdated"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <!-- Attempt to fetch updated feature -->
                    <ctl:call-test name="wfs:GetFeatureByName">
                        <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
                        <ctl:with-param name="type" select="'sf:PrimitiveGeoFeature'"/>
                        <ctl:with-param name="name.value" select="'cite.gmlsf0-f13bis'" />
                        <ctl:with-param name="empty.response" select="'false'" />
                    </ctl:call-test>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc9.1">
        <param name="wfs.Transaction.post.url"/>
        <param name="wfs.GetFeature.post.url" />
        <ctl:param name="supports.atomic.trx" />
        <assertion>
            An update request that attempts to remove a required feature property must
            give rise to an exception report.
        </assertion>
        <comment>
            Pass if the update fails and an exception report is returned.
        </comment>
        <link>wfs-1.1.0-Transaction-atc7</link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc9.1.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1/>
                </request>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="totalInserted" select="$response//wfs:totalInserted" />
                    <xsl:if test="$totalInserted != 1">
                        <ctl:message>FAILURE: Expected totalInserted = 1 (reported total is <xsl:value-of select="$totalInserted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <!-- Submit update request -->
                    <xsl:variable name="fid">
                        <xsl:value-of select="$response//wfs:InsertResults/wfs:Feature[1]/ogc:FeatureId/@fid"/>
                    </xsl:variable>
                    <xsl:variable name="response2">
                        <request>
                            <url>
                                <xsl:value-of select="$wfs.Transaction.post.url"/>
                            </url>
                            <method>POST</method>
                            <body>
                                <xi:include href="./wfs-1.1.0-Transaction-tc9.1.2.body.xml"/>
                            </body>
                        </request>
                    </xsl:variable>

                    <xsl:choose>
                        <xsl:when test="$supports.atomic.trx">
                            <ctl:call-test name="ctl:SchematronValidatingParser">
                                <ctl:with-param name="doc" select="$response2" />
                                <ctl:with-param name="schema">/sch/ows/1.0.0/ExceptionReport.sch</ctl:with-param>
                                <ctl:with-param name="phase">DefaultPhase</ctl:with-param>
                            </ctl:call-test>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:variable name="totalUpdated">
                                <xsl:value-of select="$response2//wfs:totalUpdated"/>
                            </xsl:variable>
                            <xsl:if test="$totalUpdated != 0">
                                <ctl:message>FAILURE: Expected totalUpdated = 0 (reported total is <xsl:value-of select="$totalUpdated"/>)</ctl:message>
                                <ctl:fail/>
                            </xsl:if>
                            <xsl:if test="$response2//wfs:TransactionResults/wfs:Action/@locator != 'upd-1'">
                                <ctl:message>FAILURE: Expected wfs:Action/@locator = 'upd-1'</ctl:message>
                                <ctl:fail/>
                            </xsl:if>
                        </xsl:otherwise>
                    </xsl:choose>

                    <!-- Confirm that update failed -->
                    <xsl:variable name="response3">
                        <request>
                    <url>
                        <xsl:value-of select="$wfs.GetFeature.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc7.1-2.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1/>
                </request>
                    </xsl:variable>
                    <xsl:if test="xsd:double($response3//sf:AggregateGeoFeature/sf:doubleProperty) != xsd:double('2.4510E4')">
                        <ctl:message>FAILURE: Expected sf:doubleProperty = 2.4510E4 (<xsl:value-of select="$fid"/>.</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc10.1">
        <param name="wfs.Transaction.post.url"/>
        <ctl:param name="supports.atomic.trx" />
        <assertion>
            An update request that attempts to update a property with an incongruent
            value must fail; the failing update statements must be referenced in the
            transaction response.
        </assertion>
        <comment>
            Pass if all failed update statements have corresponding wfs:Action elements
            in the response.
        </comment>
        <link>wfs-1.1.0-Transaction-atc7</link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc10.1.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1/>
                </request>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing or invalid response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="totalInserted" select="$response//wfs:totalInserted" />
                    <xsl:if test="$totalInserted != 1">
                        <ctl:message>FAILURE: Expected totalInserted = 1 (reported total is <xsl:value-of select="$totalInserted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <!-- Submit update request -->
                    <xsl:variable name="fid">
                        <xsl:value-of select="$response//wfs:InsertResults/wfs:Feature[1]/ogc:FeatureId/@fid"/>
                    </xsl:variable>
                    <xsl:variable name="response2">
                        <request>
                            <url>
                                <xsl:value-of select="$wfs.Transaction.post.url"/>
                            </url>
                            <method>POST</method>
                            <body>
                                <xi:include href="./wfs-1.1.0-Transaction-tc10.1.2.body.xml"/>
                            </body>
                            <p:XMLValidatingParser.GMLSF1/>
                        </request>
                    </xsl:variable>
                    <!-- accommodate fine-grained or coarse-grained transactions -->
                    <xsl:choose>
                        <xsl:when test="not($supports.atomic.trx)">
                            <xsl:variable name="totalUpdated" select="$response2//wfs:totalUpdated" />
                            <xsl:if test="$totalUpdated != 0">
                                <ctl:message>FAILURE: Expected totalUpdated = 0 (reported total is <xsl:value-of select="$totalUpdated"/>)</ctl:message>
                                <ctl:fail/>
                            </xsl:if>
                            <xsl:if test="count($response2//wfs:TransactionResults/wfs:Action) != 2">
                                <ctl:message>FAILURE: Expected 2 wfs:Action elements in response.</ctl:message>
                                <ctl:fail/>
                            </xsl:if>
                        </xsl:when>
                        <xsl:otherwise>
                            <ctl:call-test name="ctl:SchematronValidatingParser">
                                <ctl:with-param name="doc" select="$response2" />
                                <ctl:with-param name="schema">/sch/ows/1.0.0/ExceptionReport.sch</ctl:with-param>
                                <ctl:with-param name="phase">DefaultPhase</ctl:with-param>
                            </ctl:call-test>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc11.1">
        <param name="wfs.Transaction.post.url"/>
        <param name="wfs.GetFeature.get.url"/>
        <param name="wfs.GetFeature.post.url"/>
        <ctl:param name="wfs.GetCapabilities.document" />
        <assertion>
            In response to an update request that does not include a value for an optional
            property, the property shall be removed.
        </assertion>
        <comment>
            Pass if the update succeeds and the properties are removed.
        </comment>
        <link>wfs-1.1.0-Transaction-atc7</link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc11.1.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1/>
                </request>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="totalInserted" select="$response//wfs:totalInserted" />
                    <xsl:if test="$totalInserted != 1">
                        <ctl:message>FAILURE: Expected totalInserted = 1 (reported total is <xsl:value-of select="$totalInserted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <!-- Submit update request -->
                    <xsl:variable name="fid">
                        <xsl:value-of select="$response//wfs:InsertResults/wfs:Feature[1]/ogc:FeatureId/@fid"/>
                    </xsl:variable>
                    <xsl:variable name="response2">
                        <request>
                            <url>
                                <xsl:value-of select="$wfs.Transaction.post.url"/>
                            </url>
                            <method>POST</method>
                            <body>
                                <xi:include href="./wfs-1.1.0-Transaction-tc11.1.2.body.xml"/>
                            </body>
                            <p:XMLValidatingParser.GMLSF1/>
                        </request>
                    </xsl:variable>
                    <xsl:variable name="totalUpdated" select="$response2//wfs:totalUpdated" />
                    <xsl:if test="$totalUpdated != 1">
                        <ctl:message>FAILURE: Expected totalUpdated = 1 (reported total is <xsl:value-of select="$totalUpdated"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <xsl:variable name="response3">
                        <request>
                    <url>
                        <xsl:value-of select="$wfs.GetFeature.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc7.1-2.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1/>
                </request>
                    </xsl:variable>
                    <xsl:if test="count($response3//sf:PrimitiveGeoFeature/gml:name) != 0">
                        <ctl:message>FAILURE: Expected no gml:name properties (<xsl:value-of select="$fid"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc12.1">
        <param name="wfs.Transaction.post.url"/>
        <assertion>
            The response to a Transaction request that includes a delete statement
            without a filter (i.e. an invalid request) must include an exception report.
        </assertion>
        <comment>Pass if all of the following conditions are true: (1) the response
            is a valid ows:ExceptionReport; (2) the reported exceptionCode is "MissingParameterValuePhase".
        </comment>
        <link>wfs-1.1.0-Transaction-atcX</link>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc12.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.OWS />
                </request>
            </xsl:variable>

            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <ctl:call-test name="ctl:SchematronValidatingParser">
                        <ctl:with-param name="doc" select="$response" />
                        <ctl:with-param name="schema">/sch/ows/1.0.0/ExceptionReport.sch</ctl:with-param>
                        <ctl:with-param name="phase">MissingParameterValuePhase</ctl:with-param>
                    </ctl:call-test>
                </xsl:otherwise>
            </xsl:choose>
        </code>
    </test>

    <test name="wfs:wfs-1.1.0-Transaction-tc13.1">
        <param name="wfs.Transaction.post.url"/>
        <param name="wfs.GetFeature.get.url"/>
        <param name="wfs.GetFeature.post.url"/>
        <ctl:param name="wfs.GetCapabilities.document" />
        <assertion>
            In response to a valid delete request, all matching features shall be deleted.
        </assertion>
        <comment>
            Pass if the delete actions succeed.
        </comment>
        <code>
            <xsl:variable name="response">
                <request>
                    <url>
                        <xsl:value-of select="$wfs.Transaction.post.url"/>
                    </url>
                    <method>POST</method>
                    <body>
                        <xi:include href="./wfs-1.1.0-Transaction-tc13.1.1.body.xml"/>
                    </body>
                    <p:XMLValidatingParser.GMLSF1/>
                </request>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="not($response/*)">
                    <ctl:message>FAILURE: Missing response entity.</ctl:message>
                    <ctl:fail/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="totalInserted" select="$response//wfs:totalInserted" />
                    <xsl:if test="$totalInserted != 3">
                        <ctl:message>FAILURE: Expected totalInserted = 3 (reported total is <xsl:value-of select="$totalInserted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <!-- Submit delete request -->
                    <xsl:variable name="fid1">
                        <xsl:value-of select="$response//wfs:InsertResults/wfs:Feature[1]/ogc:FeatureId/@fid"/>
                    </xsl:variable>
                    <xsl:variable name="fid2">
                        <xsl:value-of select="$response//wfs:InsertResults/wfs:Feature[2]/ogc:FeatureId/@fid"/>
                    </xsl:variable>
                    <xsl:variable name="fid3">
                        <xsl:value-of select="$response//wfs:InsertResults/wfs:Feature[3]/ogc:FeatureId/@fid"/>
                    </xsl:variable>
                    <xsl:variable name="response2">
                        <request>
                            <url>
                                <xsl:value-of select="$wfs.Transaction.post.url"/>
                            </url>
                            <method>POST</method>
                            <body>
                                <xi:include href="./wfs-1.1.0-Transaction-tc13.1.2.body.xml"/>
                            </body>
                            <p:XMLValidatingParser.GMLSF1/>
                        </request>
                    </xsl:variable>
                    <xsl:variable name="totalDeleted" select="$response2//wfs:totalDeleted" />
                    <xsl:if test="$totalDeleted != 3">
                        <ctl:message>FAILURE: Expected totalDeleted = 3 (reported total is <xsl:value-of select="$totalDeleted"/>)</ctl:message>
                        <ctl:fail/>
                    </xsl:if>
                    <!-- check all three features were deleted -->
                        <ctl:call-test name="wfs:GetFeatureByName">
                          <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
                          <ctl:with-param name="type" select="'sf:PrimitiveGeoFeature'"/>
                          <ctl:with-param name="name.value" select="'cite.gmlsf0-f16'" />
                          <ctl:with-param name="empty.response" select="'true'" />
                        </ctl:call-test>
                        <ctl:call-test name="wfs:GetFeatureByName">
                          <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
                          <ctl:with-param name="type" select="'sf:PrimitiveGeoFeature'"/>
                          <ctl:with-param name="name.value" select="'cite.gmlsf0-f17'" />
                          <ctl:with-param name="empty.response" select="'true'" />
                        </ctl:call-test>
                        <ctl:call-test name="wfs:GetFeatureByName">
                          <ctl:with-param name="wfs.GetFeature.post.url" select="$wfs.GetFeature.post.url"/>
                          <ctl:with-param name="type" select="'sf:EntitéGénérique'"/>
                          <ctl:with-param name="name.value" select="'cite.gmlsf0-f18'" />
                          <ctl:with-param name="empty.response" select="'true'" />
                        </ctl:call-test>
            </xsl:otherwise>
            </xsl:choose>

        </code>
    </test>

    <ctl:test name="wfs:Transaction-invalid-lock">
        <ctl:param name="CAPABILITIES" />
        <ctl:assertion>A transaction request with an invalid lock identifier returns an exception.</ctl:assertion>
        <ctl:comment></ctl:comment>
        <ctl:link>OGC 04-094, 12.2.3, p.65</ctl:link>
        <ctl:code>
            <xsl:choose>
                <xsl:when test="not($CAPABILITIES/wfs:FeatureTypeList/wfs:FeatureType[wfs:Name='sf:PrimitiveGeoFeature'])">
                    <ctl:message>sf:PrimitiveGeoFeature does not exist</ctl:message>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="RESPONSE">
                        <ctl:request>
                            <ctl:url>
                                <xsl:value-of select="$CAPABILITIES/ows:OperationsMetadata/ows:Operation[@name='Transaction']/ows:DCP/ows:HTTP/ows:Post/@xlink:href"/>
                            </ctl:url>
                            <method>POST</method>
                            <body>
                                <wfs:Transaction service="WFS" version="1.1.0"
                                                                         xmlns:wfs="http://www.opengis.net/wfs"
                                                                         xmlns:gml="http://www.opengis.net/gml"
                                                                         xmlns:ogc="http://www.opengis.net/ogc"
                                                                         xmlns:sf="http://cite.opengeospatial.org/gmlsf">
                                    <wfs:LockId>InvalidLockId</wfs:LockId>
                                    <wfs:Update handle="upd-1" typeName="sf:PrimitiveGeoFeature">
                                        <wfs:Property>
                                            <wfs:Name>gml:description</wfs:Name>
                                            <wfs:Value>description-f001-updated</wfs:Value>
                                        </wfs:Property>
                                        <ogc:Filter>
                                            <ogc:GmlObjectId gml:id="PrimitiveGeoFeature.01" />
                                        </ogc:Filter>
                                    </wfs:Update>
                                </wfs:Transaction>
                            </body>
                            <parsers:HTTPParser>
                                <parsers:parse>
                                    <parsers:HTTPParser/>
                                </parsers:parse>
                            </parsers:HTTPParser>
                        </ctl:request>
                    </xsl:variable>
                    <xsl:if test="not($RESPONSE//ows:Exception/*)">
                        <ctl:fail/>
                    </xsl:if>

                </xsl:otherwise>
            </xsl:choose>
        </ctl:code>
    </ctl:test>


    <ctl:test name="wfs:Transaction-idgen-generate-new">
        <ctl:param name="CAPABILITIES" />
        <ctl:assertion>In response to an Insert Transaction request with idgen=GenerateNew, the service generates unique identifiers for the newly inserted feature instances.</ctl:assertion>
        <ctl:comment></ctl:comment>
        <ctl:link>OGC 04-094, 12.2.4, p.67</ctl:link>
        <ctl:code>
            <xsl:choose>
                <xsl:when test="not($CAPABILITIES/wfs:FeatureTypeList/wfs:FeatureType[wfs:Name='sf:PrimitiveGeoFeature'])">
                    <ctl:message>sf:PrimitiveGeoFeature does not exist</ctl:message>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="INS-RESPONSE">
                        <ctl:request>
                            <ctl:url>
                                <xsl:value-of select="$CAPABILITIES/ows:OperationsMetadata/ows:Operation[@name='Transaction']/ows:DCP/ows:HTTP/ows:Post/@xlink:href"/>
                            </ctl:url>
                            <method>POST</method>
                            <body>
                                <wfs:Transaction service="WFS" version="1.1.0"
                                                                         xmlns:wfs="http://www.opengis.net/wfs"
                                                                         xmlns:gml="http://www.opengis.net/gml"
                                                                         xmlns:ogc="http://www.opengis.net/ogc"
                                                                         xmlns:sf="http://cite.opengeospatial.org/gmlsf">
                                    <wfs:Insert handle="insert-idgen" idgen="GenerateNew">
                                        <sf:PrimitiveGeoFeature >
                                            <gml:name>cite.gmlsf0-f501</gml:name>
                                            <gml:boundedBy>
                                                <gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326">
                                                    <gml:lowerCorner>48.608284 15.7836</gml:lowerCorner>
                                                    <gml:upperCorner>50.849854 20.034142</gml:upperCorner>
                                                </gml:Envelope>
                                            </gml:boundedBy>
                                            <sf:curveProperty>
                                                <gml:LineString srsName="urn:ogc:def:crs:EPSG::4326">
                                                    <gml:posList>48.608284 20.034142 50.286873 15.7836
                                                        50.849854 16.764992</gml:posList>
                                                </gml:LineString>
                                            </sf:curveProperty>
                                            <sf:intProperty>1025</sf:intProperty>
                                            <sf:measurand>63.94</sf:measurand>
                                            <sf:dateTimeProperty>2006-08-23T08:45:12-05:00</sf:dateTimeProperty>
                                            <sf:decimalProperty>92.51</sf:decimalProperty>
                                        </sf:PrimitiveGeoFeature>
                                    </wfs:Insert>
                                </wfs:Transaction>
                            </body>
                            <parsers:HTTPParser>
                                <parsers:parse>
                                    <parsers:HTTPParser/>
                                </parsers:parse>
                            </parsers:HTTPParser>
                        </ctl:request>
                    </xsl:variable>
                    <xsl:variable name="FEATUREID">
                        <xsl:value-of select="$INS-RESPONSE//wfs:InsertResults/wfs:Feature/ogc:FeatureId/@fid"/>
                    </xsl:variable>

                    <xsl:if test="$FEATUREID=''">
                        <ctl:fail/>
                    </xsl:if>
                    <!-- clean up -->
                    <xsl:variable name="RESPONSE">
                        <ctl:request>
                            <ctl:url>
                                <xsl:value-of select="$CAPABILITIES/ows:OperationsMetadata/ows:Operation[@name='Transaction']/ows:DCP/ows:HTTP/ows:Post/@xlink:href"/>
                            </ctl:url>
                            <method>POST</method>
                            <body>
                                <wfs:Transaction service="WFS" version="1.1.0"
                                                                                 xmlns:wfs="http://www.opengis.net/wfs"
                                                                                 xmlns:gml="http://www.opengis.net/gml"
                                                                                 xmlns:ogc="http://www.opengis.net/ogc"
                                                                                 xmlns:sf="http://cite.opengeospatial.org/gmlsf">
                                    <wfs:Delete typeName="sf:PrimitiveGeoFeature">
                                        <ogc:Filter>
                                            <ogc:GmlObjectId gml:id="{$FEATUREID}"/>
                                        </ogc:Filter>
                                    </wfs:Delete>
                                </wfs:Transaction>
                            </body>
                            <parsers:HTTPParser>
                                <parsers:parse>
                                    <parsers:HTTPParser/>
                                </parsers:parse>
                            </parsers:HTTPParser>
                        </ctl:request>
                    </xsl:variable>
                </xsl:otherwise>
            </xsl:choose>
        </ctl:code>
    </ctl:test>

    <ctl:test name="wfs:Transaction-idgen-use-existing">
        <ctl:param name="CAPABILITIES" />
        <ctl:assertion>In response to an Insert Transaction request with idgen=UseExisting where the identifiers are new values that do not belong to any existing features in the WFS, the service uses the existing gml:id identifiers for the newly inserted feature instances.</ctl:assertion>
        <ctl:comment></ctl:comment>
        <ctl:link>OGC 04-094, 12.2.4, p.67</ctl:link>
        <ctl:code>
            <xsl:choose>
                <xsl:when test="not($CAPABILITIES/wfs:FeatureTypeList/wfs:FeatureType[wfs:Name='sf:PrimitiveGeoFeature'])">
                    <ctl:message>sf:PrimitiveGeoFeature does not exist</ctl:message>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="INS-RESPONSE">
                        <ctl:request>
                            <ctl:url>
                                <xsl:value-of select="$CAPABILITIES/ows:OperationsMetadata/ows:Operation[@name='Transaction']/ows:DCP/ows:HTTP/ows:Post/@xlink:href"/>
                            </ctl:url>
                            <method>POST</method>
                            <body>
                                <wfs:Transaction service="WFS" version="1.1.0"
                                                                         xmlns:wfs="http://www.opengis.net/wfs"
                                                                         xmlns:gml="http://www.opengis.net/gml"
                                                                         xmlns:ogc="http://www.opengis.net/ogc"
                                                                         xmlns:sf="http://cite.opengeospatial.org/gmlsf">
                                    <wfs:Insert handle="insert-idgen" idgen="UseExisting">
                                        <sf:PrimitiveGeoFeature gml:id="PrimitiveGeoFeature.111">
                                            <gml:name>cite.gmlsf0-f501</gml:name>
                                            <gml:boundedBy>
                                                <gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326">
                                                    <gml:lowerCorner>48.608284 15.7836</gml:lowerCorner>
                                                    <gml:upperCorner>50.849854 20.034142</gml:upperCorner>
                                                </gml:Envelope>
                                            </gml:boundedBy>
                                            <sf:curveProperty>
                                                <gml:LineString srsName="urn:ogc:def:crs:EPSG::4326">
                                                    <gml:posList>48.608284 20.034142 50.286873 15.7836
                                                        50.849854 16.764992</gml:posList>
                                                </gml:LineString>
                                            </sf:curveProperty>
                                            <sf:intProperty>1025</sf:intProperty>
                                            <sf:measurand>63.94</sf:measurand>
                                            <sf:dateTimeProperty>2006-08-23T08:45:12-05:00</sf:dateTimeProperty>
                                            <sf:decimalProperty>92.51</sf:decimalProperty>
                                        </sf:PrimitiveGeoFeature>
                                    </wfs:Insert>
                                </wfs:Transaction>
                            </body>
                            <parsers:HTTPParser>
                                <parsers:parse>
                                    <parsers:HTTPParser/>
                                </parsers:parse>
                            </parsers:HTTPParser>
                        </ctl:request>
                    </xsl:variable>
                    <xsl:variable name="FEATUREID">
                        <xsl:value-of select="$INS-RESPONSE//wfs:InsertResults/wfs:Feature/ogc:FeatureId/@fid"/>
                    </xsl:variable>
                    <xsl:if test="not($FEATUREID='PrimitiveGeoFeature.111')">
                        <ctl:fail/>
                    </xsl:if>
                    <!-- clean up -->
                    <xsl:variable name="RESPONSE">
                        <ctl:request>
                            <ctl:url>
                                <xsl:value-of select="$CAPABILITIES/ows:OperationsMetadata/ows:Operation[@name='Transaction']/ows:DCP/ows:HTTP/ows:Post/@xlink:href"/>
                            </ctl:url>
                            <method>POST</method>
                            <body>
                                <wfs:Transaction service="WFS" version="1.1.0"
                                                                                 xmlns:wfs="http://www.opengis.net/wfs"
                                                                                 xmlns:gml="http://www.opengis.net/gml"
                                                                                 xmlns:ogc="http://www.opengis.net/ogc"
                                                                                 xmlns:sf="http://cite.opengeospatial.org/gmlsf">
                                    <wfs:Delete typeName="sf:PrimitiveGeoFeature">
                                        <ogc:Filter>
                                            <ogc:GmlObjectId gml:id="{$FEATUREID}"/>
                                        </ogc:Filter>
                                    </wfs:Delete>
                                </wfs:Transaction>
                            </body>
                            <parsers:HTTPParser>
                                <parsers:parse>
                                    <parsers:HTTPParser/>
                                </parsers:parse>
                            </parsers:HTTPParser>
                        </ctl:request>
                    </xsl:variable>
                </xsl:otherwise>
            </xsl:choose>
        </ctl:code>
    </ctl:test>

    <ctl:test name="wfs:Transaction-idgen-use-existing-update">
        <ctl:param name="CAPABILITIES" />
        <ctl:assertion>In response to an Insert Transaction request with idgen=UseExisting where one of the identifiers used belongs to any existing features in the WFS, the service returns an exception.</ctl:assertion>
        <ctl:comment></ctl:comment>
        <ctl:link>OGC 04-094, 12.2.4, p.67</ctl:link>
        <ctl:code>
            <xsl:variable name="RESPONSE">
                <ctl:request>
                    <ctl:url>
                        <xsl:value-of select="$CAPABILITIES/ows:OperationsMetadata/ows:Operation[@name='GetFeature']/ows:DCP/ows:HTTP/ows:Post/@xlink:href"/>
                    </ctl:url>
                    <ctl:method>POST</ctl:method>
                    <ctl:body>
                        <wfs:GetFeature service="WFS" version="1.1.0"
                                                        xmlns:wfs="http://www.opengis.net/wfs"
                                                        xmlns:gml="http://www.opengis.net/gml"
                                                        xmlns:sf="http://cite.opengeospatial.org/gmlsf">
                            <wfs:Query typeName="sf:PrimitiveGeoFeature" >
                                <ogc:Filter>
                                    <ogc:GmlObjectId gml:id="PrimitiveGeoFeature.1"/>
                                </ogc:Filter>
                            </wfs:Query>
                        </wfs:GetFeature>
                    </ctl:body>
                    <parsers:HTTPParser>
                        <parsers:parse>
                            <parsers:HTTPParser/>
                        </parsers:parse>
                    </parsers:HTTPParser>
                </ctl:request>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="not($RESPONSE//gml:featureMembers/sf:PrimitiveGeoFeature[@gml:id='PrimitiveGeoFeature.1'])">
                    <ctl:message>sf:PrimitiveGeoFeature.1 does not exist</ctl:message>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="INS-RESPONSE">
                        <ctl:request>
                            <ctl:url>
                                <xsl:value-of select="$CAPABILITIES/ows:OperationsMetadata/ows:Operation[@name='Transaction']/ows:DCP/ows:HTTP/ows:Post/@xlink:href"/>
                            </ctl:url>
                            <method>POST</method>
                            <body>
                                <wfs:Transaction service="WFS" version="1.1.0"
                                                                         xmlns:wfs="http://www.opengis.net/wfs"
                                                                         xmlns:gml="http://www.opengis.net/gml"
                                                                         xmlns:ogc="http://www.opengis.net/ogc"
                                                                         xmlns:sf="http://cite.opengeospatial.org/gmlsf">
                                    <wfs:Insert handle="insert-idgen" idgen="UseExisting">
                                        <sf:PrimitiveGeoFeature gml:id="PrimitiveGeoFeature.1">
                                            <gml:name>cite.gmlsf0-f501</gml:name>
                                            <gml:boundedBy>
                                                <gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326">
                                                    <gml:lowerCorner>48.608284 15.7836</gml:lowerCorner>
                                                    <gml:upperCorner>50.849854 20.034142</gml:upperCorner>
                                                </gml:Envelope>
                                            </gml:boundedBy>
                                            <sf:curveProperty>
                                                <gml:LineString srsName="urn:ogc:def:crs:EPSG::4326">
                                                    <gml:posList>48.608284 20.034142 50.286873 15.7836
                                                        50.849854 16.764992</gml:posList>
                                                </gml:LineString>
                                            </sf:curveProperty>
                                            <sf:intProperty>1025</sf:intProperty>
                                            <sf:measurand>63.94</sf:measurand>
                                            <sf:dateTimeProperty>2006-08-23T08:45:12-05:00</sf:dateTimeProperty>
                                            <sf:decimalProperty>92.51</sf:decimalProperty>
                                        </sf:PrimitiveGeoFeature>
                                    </wfs:Insert>
                                </wfs:Transaction>
                            </body>
                            <parsers:HTTPParser>
                                <parsers:parse>
                                    <parsers:HTTPParser/>
                                </parsers:parse>
                            </parsers:HTTPParser>
                        </ctl:request>
                    </xsl:variable>
                    <xsl:if test="not($INS-RESPONSE//ows:Exception/*)">
                        <ctl:fail/>
                    </xsl:if>
                </xsl:otherwise>
            </xsl:choose>
        </ctl:code>
    </ctl:test>

</ctl:package>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy