output.startElement(GMLSchema.NAMESPACE, "featureMember", null);
if (e == null) { // first time
e = output.findElement(f.getFeatureType().getTypeName());
// should go to an abstract FT eventually
ComplexType t = e.getType() instanceof ComplexType? (ComplexType)e.getType():null;
while(t!=null && t!=AbstractFeatureType.getInstance())
t = t.getParent() instanceof ComplexType? (ComplexType)t.getParent():null;
if(t!=AbstractFeatureType.getInstance()){
// not the right element ... try by type
e = output.findElement(value);
// should go to an abstract FT eventually
t = e.getType() instanceof ComplexType? (ComplexType)e.getType():null;
while(t!=null && t!=AbstractFeatureType.getInstance())
t = t.getParent() instanceof ComplexType? (ComplexType)t.getParent():null;
if(t!=AbstractFeatureType.getInstance()){
throw new OperationNotSupportedException("Could not find a correct Element for FeatureType "+f.getFeatureType().getTypeName());
}
}
}