Hi Laura,

The parser configured like this is better suited for parsing straight
gml, and not gml from wfs. The reason being that wfs has dependencies on
other schemas like filter, which gml does not.

However to fix this you can just change from GMLConfiguration to
OGCConfiguration in the xml-filter module. Try this out and let me know
if it works for you.

-Justin

Laura Díaz wrote:
> Hi there,
> i just downloaded the gt2-2.4-M3 version, i would like to parse a GML
> file to get the FeatureCollection,
> after adding the libraries in my classpath i tried to execute this piece
> of code:
>           InputStream input = new FileInputStream(new File(gmlFile));
>           Configuration configuration = new GMLConfiguration();
>          
> configuration.getProperties().add(Parser.Properties.PARSE_UNKNOWN_ELEMENTS);
> 
>           org.geotools.xml.StreamingParser parser = new
> org.geotools.xml.StreamingParser( configuration, input,
> "//featureMember" );
>           DefaultFeature feature = (DefaultFeature) parser.parse();  
> where the gmlFile is the attached file, i open this GML with other gml
> readers and it seems to be ok, i can visualize it with gvSIG
> I get this exception:
> 12-jun-2007 18:24:33
> org.geotools.xml.Schemas$SchemaLocationResolverAdapter
> resolveSchemaLocation
> ADVERTENCIA: Could not resolve schema location:
> ../../filter/1.0.0/filter.xsd to physical location.
> 12-jun-2007 18:24:33 org.geotools.xml.impl.ParserHandler startElement
> ADVERTENCIA: Error parsing:
> http://schemas.opengeospatial.net/wfs/1.0.0/WFS-basic.xsd
> 
> any ideas?
> 
> thanks
> Laura.
> 
> 
> !DSPAM:4007,46764da5320565210051143!
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> 
> !DSPAM:4007,46764da5320565210051143!
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> 
> 
> !DSPAM:4007,46764da5320565210051143!


-- 
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to