Hi Mathieu,

Unfortunately I don't really have a good answer for this. Probably the 
only way would be if the xml document being parsed contained a 
schemaLocation attribute. In GeoServer we face this problem with wfs. 
When a WFS request comes in we need to figure out what version of wfs to 
use to parse. So what we do is use a streaming parser (xmlpull) to parse 
the first element. We look for a version attribute and use that to 
parse. You could so something similar with schemaLocation.

If you don't have schemaLocation... then I don't know... there would not 
really be a good way to differentiate the two that I can think of.

-Justin

Mathieu Coudert wrote:
> Hi all,
> 
> Playing with Parser and Filter Encoding I have a simple question 
> concerning Parser configuration.
> 
> I'm looking for a generic way to handle both gml2 and gml3 included in 
> filter I provide to my parser.
> For that I can just define two parsers with specific configuration (ie 
> filter.v1_1.OGCConfiguration for parser handling GML3, and 
> filter.v1_0.OGCConfiguration for the other one).
> 
> But my question is how can I check second expression return in my filter 
> cause if it's null I could try with other parser ?
> 
> Filter filter = (Filter) new Parser( new 
> org.geotools.filter.v1_0.OGCConfiguration()).parse (new 
> StringReader(my_FE_string_with_GML));
> 
> Any idea or other way to handle that ?
> Thanks,
> 
> Cheers,
> Mathieu
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Geotools-devel mailing list
> Geotools-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel


-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to