Hi there,
parsing of OGC filter version 2.0 documents always ends up with an Hashmap.
I'm using Geotools 2.7.1.
Here is my code :
Main
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import org.geotools.filter.v2_0.FESConfiguration;
import org.geotools.xml.Parser;
public class MainXML {
public static void main(String[] args) {
try {
InputStream in = new FileInputStream(new
File("C:\\Broker\\Workspace\\GeoToolsTest\\src\\OGCFilter.xml"));
Parser parser = new Parser(new FESConfiguration());
Object parsedObject = parser.parse(in);
System.out.println(parsedObject.getClass().getName());
System.out.println(parsedObject);
} catch (Exception e) {
e.printStackTrace();
}
}
}
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
OGCFilter.xml
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0"?>
<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/fes/2.0
http://schemas.opengis.net/filter/2.0/filterAll.xsd">
<fes:PropertyIsEqualTo>
<fes:ValueReference>SomeProperty</fes:ValueReference>
<fes:Literal>100</fes:Literal>
</fes:PropertyIsEqualTo>
</fes:Filter>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Output
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
java.util.HashMap
{ValueReference=SomeProperty, Literal=100}
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users