chipping in really late, sorry. There might be a way to at least alleviate the problem without any code change... You're right the filter spec does not say anything about non existent properties, and the current behaviour is 'consistent' with xpath in that X-Path will return an 'empty list' when an element doesn't exist.
But the CSW spec (where CQL is defined) does talk about property existance and hence there's predicate for it: <http://docs.codehaus.org/display/GEOTOOLS/CQL+Parser +Design#CQLParserDesign-ExistencePredicate> which in geotools,if I remember correctly,is turned into a PropertyExists function. So whenever you need to be sure the property exists you can use that? not sure how far it will take you wrt error reporting though On Tue, 2010-09-21 at 14:10 +0800, Niels wrote: > On 21/09/10 12:05, Jody Garnett wrote: > > I understand the problem with using null to represent two cases; can > > you check the filter and xpath specifications to see how they handle > > this problem? Do they produce an error; or return an empty result? > > The answer may inform what we do here; perhaps they have thought of > > a good way to be clear? > It seems to me that the filter specification doesn't mention the case > of non-existent properties at all. It only mentions the case of a null > value > > The <PropertyIsNull> element encodes an operator that checks to see if > the value of its content is NULL. A NULL is equivalent to no value > present. The value 0 is a valid value and is not considered NULL. > > 'The value of its content' implies to me that there is still a > property, but this is open for interpretation of course. > > X-Path will return an 'empty list' when an element doesn't exist. > There isn't really such a thing as null values in xpath as such. > > > If you have a builder object for your mapping file could you make > > use of additional information to prevent an invalid mapping file > > being produced? Allow it to throw exceptions of the filters being > > passed in do not match the data they are to run on? > > > Hmmm mappings are expressions that can contain functions, operators, > etc... and properties can be evaluated with several property > accessors. I do no see how the property names can be tested without > recursively going through the expression tree and trying the several > property accessors - basically evaluating it. > -- > Niels Charlier > > Software Engineer > CSIRO Earth Science and Resource Engineering > Phone: +61 8 6436 8914 > > Australian Resources Research Centre > 26 Dick Perry Avenue, Kensington WA 6151 > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ Geotools-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-devel -- Gabriel Roldan [email protected] Expert service straight from the developers ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
