I'm currently working on the GetCapabilties request for a CSW which
requires that I set a FiltersCapabilities block in the XML. I was all going
well until I tried validating the output and discovered what look like
issues in the GeoTools XML encoding of the Filter spec. Before I file bugs
and work on a fix I thought I should check I'm really understanding this
correctly.
First I'm using
http://schemas.opengis.net/filter/1.1.0/filterCapabilities.xsd as the
reference schema - which should match out filter factory according to the
headers. I'm setting the encoder up using the following:
try {
final Encoder encoder = new Encoder(conf);
encoder.setIndenting(true);
encoder.setNamespaceAware(true);
encoder.getNamespaces().declarePrefix("ows", OWS.NAMESPACE);
encoder.getNamespaces().declarePrefix("ogc", OGC.NAMESPACE);
encoder.getNamespaces().declarePrefix("gml", GML.NAMESPACE);
encoder.getNamespaces().declarePrefix("xlink", XLINK.NAMESPACE);
encoder.setSchemaLocation(OWS.NAMESPACE, SCHEMALOCATION +
"ows/1.0.0/owsCommon.xsd");
encoder.setSchemaLocation(OGC.NAMESPACE,
"http://schemas.opengis.net/filter/1.1.0/filterCapabilities.xsd");
encoder.setSchemaLocation(CSW.NAMESPACE, SCHEMALOCATION +
"csw/2.0.2/CSW-discovery.xsd");
encoder.setSchemaLocation(XLINK.NAMESPACE, SCHEMALOCATION +
"xlink/1.0.0/xlinks.xsd");
// encoder.getNamespaces().declarePrefix("fes", FES.NAMESPACE);
encoder.encode(resp, CSW.Capabilities, out);
} catch (final IOException e) {
LOGGER.debug(e.getMessage(), e);
throw new EBRIMException("Problem encoding the response", e);
}
This then gives the wrong names for PropertyIsGreaterThanOrEqualTo.NAME
and PropertyIsLessThanOrEqualTo.NAME both of which have an Or in them but
shouldn't have.
ArithmeticOperators contains a empty Functions element which it shouldn't
(it's a choice with minOccurs=1) so if there are no functions then there
should be no Functions element at all. (interestingly I also noticed that
if you use the copy constructor on an ArithmeticOperatorImpl - you get a
different answer
(<ogc:Functions><ogc:FunctionNames></ogc:FunctionNames></ogc:Functions>)
which is also wrong.
With no ID filters set you get <ogc:Id_Capabilities /> which is invalid for
the same reason.
Am I right that these are broken?
Cheers
Ian
--
Ian Turton
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel