if (version == Version.WFS1_0) {
Encoder e = new Encoder(new org.geotools.wfs.v1_0.WFSConfiguration());
e.getNamespaces().declarePrefix(prefix, namespace);
e.setIndenting(true);
FeatureCollectionType featureCollectionType = WfsFactory.eINSTANCE
.createFeatureCollectionType();
featureCollectionType.getFeature().add(collection);
e.encode(featureCollectionType, org.geotools.wfs.WFS.FeatureCollection, out);
}
if (version == Version.WFS1_1) {
Encoder e = new Encoder(new org.geotools.wfs.v1_1.WFSConfiguration());
e.getNamespaces().declarePrefix(prefix, namespace);
e.setIndenting(true);
FeatureCollectionType featureCollectionType = WfsFactory.eINSTANCE
.createFeatureCollectionType();
featureCollectionType.getFeature().add(collection);
e.encode(featureCollectionType, org.geotools.wfs.WFS.FeatureCollection, out);
}
}