3

If I want to list stored queries I get this error:

org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 735; The element type "null:ValueReference" must be terminated by the matching end-tag "</null:ValueReference>"

I found out, why this error occurs.

I created the Stored Query with this XML

<wfs:CreateStoredQuery service="WFS" version="2.0.0" xmlns="http://www.opengis.net/wfs/2.0" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:fes="http://www.opengis.org/fes/2.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wfs:StoredQueryDefinition id="test">
        <wfs:Parameter name="gemarkungsname" type="xsd:string"/>
        <wfs:QueryExpressionText returnFeatureTypes="KRE_ALKIS:sg_flurstueck_f" language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression" isPrivate="false">
            <wfs:Query typeNames="KRE_ALKIS:sg_flurstueck_f">
                <fes:Filter>
                    <fes:PropertyIsEqualTo>


    <fes:ValueReference>gemarkungsname</fes:ValueReference>${gemarkungsname}</fes:PropertyIsEqualTo>
                    </fes:Filter>
                </wfs:Query>
            </wfs:QueryExpressionText>
        </wfs:StoredQueryDefinition>
    </wfs:CreateStoredQuery>

But on the server in the data directory was this XLS stored. Here you can see <null:Filter instead of <fes:Filter.

<?xml version="1.0" encoding="UTF-8"?><wfs:StoredQueryDescription xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" id="test">
    <wfs:Parameter name="gemarkungsname" type="xs:string"/>
    <wfs:QueryExpressionText isPrivate="false" language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression" returnFeatureTypes="KRE_ALKIS:sg_flurstueck_f">
        <wfs:Query wfs:typeNames="KRE_ALKIS:sg_flurstueck_f">
            <null:Filter xmlns:null="http://www.opengis.org/fes/2.0">
                <null:PropertyIsEqualTo>${gemarkungsname}<null:ValueReference>gemarkungsname</fes:ValueReference>
                </fes:PropertyIsEqualTo>
            </fes:Filter>
        </wfs:Query>
    </wfs:QueryExpressionText>
</wfs:StoredQueryDescription>

I wonder, why the null is saved instead of fes in my Stored Query in the data directory? I can edit the XML file. I can change here null to fes and everything works fine.

Then I had a look into the capabilites with geoserver/wfs?service=wfs&version=2.0.0&request=GetCapabilities. I guess I'm making a mistake in the syntax. Here the relevant part:

<fes:Filter_Capabilities>
    <fes:Conformance>
        <fes:Constraint name="ImplementsQuery">
            <ows:NoValues/>
            <ows:DefaultValue>TRUE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsAdHocQuery">
            <ows:NoValues/>
            <ows:DefaultValue>TRUE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsFunctions">
            <ows:NoValues/>
            <ows:DefaultValue>TRUE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsResourceId">
            <ows:NoValues/>
            <ows:DefaultValue>TRUE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsMinStandardFilter">
            <ows:NoValues/>
            <ows:DefaultValue>TRUE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsStandardFilter">
            <ows:NoValues/>
            <ows:DefaultValue>TRUE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsMinSpatialFilter">
            <ows:NoValues/>
            <ows:DefaultValue>TRUE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsSpatialFilter">
            <ows:NoValues/>
            <ows:DefaultValue>TRUE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsMinTemporalFilter">
            <ows:NoValues/>
            <ows:DefaultValue>TRUE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsTemporalFilter">
            <ows:NoValues/>
            <ows:DefaultValue>TRUE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsVersionNav">
            <ows:NoValues/>
            <ows:DefaultValue>FALSE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsSorting">
            <ows:NoValues/>
            <ows:DefaultValue>TRUE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsExtendedOperators">
            <ows:NoValues/>
            <ows:DefaultValue>FALSE</ows:DefaultValue>
        </fes:Constraint>
        <fes:Constraint name="ImplementsMinimumXPath">
            <ows:NoValues/>
            <ows:DefaultValue>TRUE</ows:DefaultValue>
        </fes:Constraint>
    </fes:Conformance>
    <fes:Id_Capabilities>
        <fes:ResourceIdentifier name="fes:ResourceId"/>
    </fes:Id_Capabilities>
    <fes:Scalar_Capabilities>
        <fes:LogicalOperators/>
        <fes:ComparisonOperators>
            <fes:ComparisonOperator name="PropertyIsLessThan"/>
            <fes:ComparisonOperator name="PropertyIsGreaterThan"/>
            <fes:ComparisonOperator name="PropertyIsLessThanOrEqualTo"/>
            <fes:ComparisonOperator name="PropertyIsGreaterThanOrEqualTo"/>
            <fes:ComparisonOperator name="PropertyIsEqualTo"/>
            <fes:ComparisonOperator name="PropertyIsNotEqualTo"/>
            <fes:ComparisonOperator name="PropertyIsLike"/>
            <fes:ComparisonOperator name="PropertyIsBetween"/>
            <fes:ComparisonOperator name="PropertyIsNull"/>
            <fes:ComparisonOperator name="PropertyIsNil"/>
        </fes:ComparisonOperators>
    </fes:Scalar_Capabilities>

WFS and Geoserver - what exactly is FES and what is the correct syntax?

1
  • geoserver/wfs?service=wfs&version=2.0.0&request=GetCapabilities strictly the request should be geoserver/wfs?service=WFS&acceptversions=2.0.0&request=GetCapabilities
    – nmtoken
    Dec 14, 2019 at 10:37

1 Answer 1

2

FES is the shorthand used for the Filter Encoding Specification and is defined by xmlns:fes="http://www.opengis.net/fes/2.0". The fes bit is just an arbitrary string and could be anything.

The fact it keeps becoming NULL when stored looks like a bug, so you should ask on the GeoServer users list and then probably open a ticket about it.

1
  • Thank you Ian. I subscribed and sent an email to the address [email protected]. Up to now I do not find it on the user list. But perhaps it take some more time?
    – astridx
    Dec 14, 2019 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.