Hi Gabriel, My original message was a bit off. After looking into this some more it seems that "gml:name" is a "CodeType", which is indeed a complex type which extends a simple type. However there is no binding directly to gml:name or to "gml:CodeType", so the "xs:string" binding si the first one to execute.
So if you register a binding for the "CodeType" type, you should get what you need as its a ComplexBinding. -Justin Gabriel Roldán wrote: > Hi Justin, > > Working on gtxml encoding and now parsing I guess I've found a design > limitation, though it can well be a limitation on my brain. > > Problem is I'm not being able of encoding non complex (in the nesting > sense) elements with xml attributes. > > Say I have to encode gml:name but it needs the codeSpace attribute: > > <gml:name codeSpace="myuri">value</gml:name> > > This kind of encodings are generally made through a SimpleBinding, > which, by one side, have no getProperty() method which could be used to > retrieve the attribute values, and by the other side, > SimpleBinding.encode() is expected to return an String and does not > recieves the Element it is going to be encoded at, so it is not possible > to set the attributes in the encode() implementation. > > Moreover, the Encoder seems to never try to encode the attributes when > it is a SimpleBinding. > > By trying to overcome this limitation, I've made a custom binding for > xs:anySimpleType, which is a ComplexBinding instead of a SimpleBinding. > It was working alright for encoding, as that way I can set the > attributes inside encode(). > > The problem arises when I send a HTTP POST GetFeature request, since it > uses the parser to build the request object, then ParseExecutor fails > with a ClassCastException at line 132, trying to cast an AttrtibuteImpl > to an ElementInstance. > > Hope I'm making some sense, in any case, feel free to contact me through > im as soon as you have a chance. > > regards, > > Gabriel > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > 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-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-devel -- Justin Deoliveira The Open Planning Project [EMAIL PROTECTED] ------------------------------------------------------------------------- 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-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
