Yeah, complex types with simple content are a pain for sure. I created a special binding (SimpleContentComplexEMFBinding) for these cases but only when the target is an EMF generated model.
So yeah, the geotools attribute type that gets created in GMLSchema is just generated, and should probably be changed after the fact. That is what i have done for other types which actually have an object in geotools they map to, like geometries for instance. If we have some time perhaps we can just change the code generator to create a more suitable attribute type. What object will gml:CodeType map to in our code base. As I understand it just a string with an associated URI? Is there an object in geoapi for this? Ben Caradoc-Davies wrote: > I am not sure if this is the right thing to do, until we have decided on > a long-term solution for complexType-with-simpleContent, that is, how to > accommodate it within GeoAPI. > > Is gml:identifier also a gml:CodeType? > > Rob Atkinson wrote: >> So you are saying I should look at creating a gml:Name handler while >> I'm in the core of xsd-gml and have Justin's attention to review it? >> >> I will then have to back out the hack from app-schemas >> >> Rob >> >> On Thu, Nov 20, 2008 at 1:54 PM, Ben Caradoc-Davies >> <[EMAIL PROTECTED]> wrote: >>> Rob Atkinson wrote: >>>> Also, I couldnt find a binding for gml:name, so not sure how to add >>>> gml:identifier. What is supposed to be happening here - is it simply >>>> handled as a complex feature type generic binding? >>> Rob, gml:name is a gml:CodeType; this is a complexType with >>> simpleContent, >>> so is poorly supported by gt-xsd-gml3, as previously discussed on the >>> list. >>> >>> This type is bound in GMLSchema as a ComplexType: >>> >>> public static final ComplexType CODETYPE_TYPE = new ComplexTypeImpl( >>> new NameImpl("http://www.opengis.net/gml", "CodeType"), >>> Collections.EMPTY_LIST, false, false, >>> Collections.EMPTY_LIST, XSSchema.STRING_TYPE, null); >>> >>> There is nowhere to store the simple content (string in this case), >>> because >>> the value of a complex attribute is a Collection. In app-schema I >>> create a >>> fake simpleContent attribute with the appropriate binding type to >>> store the >>> simple content. This is implemented in XPath; >>> http://svn.geotools.org/trunk/modules/unsupported/app-schema/app-schema/src/main/java/org/geotools/data/complex/filter/XPath.java >>> >>> >>> >>> This is an Ugly Hack (TM). GMLConfiguration will in the future look >>> for this >>> content and unpack it at encoding time. Yuck. >>> >>> -- >>> Ben Caradoc-Davies <[EMAIL PROTECTED]> >>> Software Engineer, CSIRO Exploration and Mining >>> Australian Resources Research Centre >>> 26 Dick Perry Ave, Kensington WA 6151, Australia >>> > > -- Justin Deoliveira OpenGeo - http://opengeo.org Enterprise support for open source geospatial. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel