Hi Fabio, I just added a faq for your question :).
http://docs.codehaus.org/display/GEOTDOC/XML+Parsing+and+Encoding+FAQ Also, if you want you can use svn to check out the source code directly from our geotools repository. http://svn.geotools.org/geotools/trunk/gt -Justin Fabio Luiz Leite wrote: > Hi Justin (and all), > > How to parse a ogc filter using version 2.3 ? I tryed the following > code, but an error happened on creation of FilterFilter: > > // instantiante parsers and content handlers > MyHandler contentHandler = new MyHandler(); > FilterFilter filterParser = new FilterFilter(contentHandler, null); > GMLFilterGeometry geometryFilter = new > GMLFilterGeometry(filterParser); > GMLFilterDocument documentFilter = new > GMLFilterDocument(geometryFilter); > > // read in XML file and parse to content handler > > SAXParserFactory factory = SAXParserFactory.newInstance(); > SAXParser parser = factory.newSAXParser(); > ParserAdapter adapter = new ParserAdapter( parser.getParser()); > adapter.setContentHandler(documentFilter); > adapter.parse(requestSource); > > assertEquals(contentHandler.filters.size(),1); > > LogicFilterImpl f = (LogicFilterImpl) contentHandler.filters.get(0); > List sub = f.getChildren(); > assertEquals(2,sub.size()); > > Filter f1 = (Filter) sub.get(0); > Filter f2 = (Filter) sub.get(1); > > assertEquals(FilterType.GEOMETRY_INTERSECTS,f1.getFilterType()); > assertEquals(FilterType.GEOMETRY_BBOX, f2.getFilterType()); > > > > Could you tell me more info about how to get the 2.4 version ? I am > interested. > > On 1/22/07, *Justin Deoliveira* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > Hi Fabio, > > Actually this a new way to parse a filter and is only available in > geotools 2.4 which is yet to be released. > > If you want to use this code, you will need to check out the geotools > 2.4 ( trunk ) branch and build it from source. > > Let me know if you are interested and want more info on how to do so. > > -Justin > > Fabio Luiz Leite wrote: > > Hi all, > > i'm trying to run an example of the user guide about > Filter XML > > Support. But, when i run the sample, i'm getting a lot of errors. > > > > The parser in the sample follows: > > > > //create the parser with the filter 1.0 configuration > > org.geotools.xml.Configuration = new > org.geotools.filter.v1_0.OGCConfiguration(); > > org.geotools.xml.Parser > > parser = new org.geotools.xml.Parser( configuration ); > > > > //the xml instance document above > > InputStream xml = ... > > > > > > //parse > > Filter filter = (Filter) parser.parse( xml ); > > > > > > Is this a deprecated way to parse a filter ? > > How to run this code using geotools version 2.3 ? > > > > Thanks in advance ! > > > > -- > > Fábio Luiz Leite Júnior > > > > > > > ------------------------------------------------------------------------ > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > > opinions on IT & business topics through brief surveys - and earn > cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> > > > > !DSPAM:1004,45b51a3095047731818748! > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Geotools-gt2-users mailing list > > [email protected] > <mailto:[email protected]> > > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > > > > > !DSPAM:1004,45b51a3095047731818748! > > > -- > Justin Deoliveira > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > The Open Planning Project > http://topp.openplans.org > > > > > -- > Fábio Luiz Leite Júnior !DSPAM:1004,45b52227100181510810322! > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > !DSPAM:1004,45b52227100181510810322! > > > ------------------------------------------------------------------------ > > _______________________________________________ > Geotools-gt2-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > > !DSPAM:1004,45b52227100181510810322! -- Justin Deoliveira [EMAIL PROTECTED] The Open Planning Project http://topp.openplans.org ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
