Hi Gabriel,

Yes, you are correct, this is definitley an api issue. I guess I never 
thought about this when I designed the api. So the change should not be 
too much. All we need to do is add a new method called getProperty() to 
SimpleBinding like for ComplexBinding. Then GetPropertyExecutor will 
have to modified slightly to obtain the properties from simple bindings.

If you want to try your hand at this feel free. Adding the new method to 
SimpleBInding may introduce some breakage. However we can use 
AbstactSimpleBinding to help with some of that. However there may be 
some bindengs that still implement the interface directly. If you find 
any please change them to extend AbstractSimpleBinding.

I know its end of day for you so I will try to get to this at the end of 
the day.

-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
> 


-- 
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to