On Tue, Oct 5, 2010 at 11:13 AM,  <rini.angre...@csiro.au> wrote:
> OK Victor pointed out that your attributes x and y have minOccurs = 0, and 
> that they should be skipped.
> He actually put in a logic that will skip the parent's attributes if the 
> children are missing (skipped) and the parent itself is nillable.
> However, this is done after the feature is built, after it passes validations 
> so it's way too late.. And would only work for complex attributes (since they 
> never get validated).
> It's in DataAccessMappingFeatureIterator.cleanEmptyElements(). I guess this 
> is a bug then.. We need to do something similar for non-complex attributes.

Well, I'm ready to try and code a fix if only I get some guidance.
A way to handle this could be to move validation to a later stage:
first build the feature entirely (and eventually simplify it) and then
validate it.

Actually if you look at simple features we don't have automatic
validation at all, validation is optional and performed only on
demand.
Wondering if that should just be the default for complex features as
well.. it would make some sense, as of now I have a JTS Point
inside of a DirectPosition and the store is not complaining. Special
casing simple attributes makes for confusing behavior imho (e.g.,
by default it should validate everything, or nothing at all... and I'd
vote for the second).

Cheers
Andrea


-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584962313
fax:     +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to