jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ard Schrijvers <a.schrijv...@onehippo.com>
Subject Re: Support of < and <= operators in XPath queries
Date Tue, 12 Oct 2010 06:58:52 GMT
Julian is correct about the second query: it is incorrect. That is
doesn't return you errors surprises me. I just tested the following:

 'A' < @demosite:title and
 @demosite:title < 'A'

both return the same hits! Thus currently ( 'A' < @demosite:title  )
is not equal to (@demosite:title > 'A') !!

For safety, I'd stick to first stating the property, then the value.

Last, I assume @myapp:date contains Calendar instances? In that case
you should use as value in xpath:


"xs:dateTime('"+ValueFactoryImpl.getInstance().createValue(value).getString()
+ "')"

where value is the Calendar instance

Regards Ard

On Tue, Oct 12, 2010 at 8:31 AM,  <Sascha.Theves@innovations.de> wrote:
>
> Hi,
>
> the query is not invalid, it works. I have tested it and it is the only way to get it
working.
>
> Cheers
>
> Sascha
>
> -----Ursprüngliche Nachricht-----
> Von: Julian Reschke [mailto:julian.reschke@gmx.de]
> Gesendet: Mo 11.10.2010 18:50
> An: users@jackrabbit.apache.org
> Cc: Theves Sascha
> Betreff: Re: Support of < and <= operators in XPath queries
>
> On 11.10.2010 13:52, Sascha.Theves@innovations.de wrote:
>> Hi all,
>>
>>
>>
>> I have the following XPath query:
>>
>>
>>
>> //element(*, nt:base) [@myapp:date>  '2010-10-11T13:43:14.230+02:00']
>>
>>
>>
>> If the condition of the query returns true then this query:
>>
>>
>>
>> //element(*, nt:base) ['2010-10-11T13:43:14.230+02:00'<  @myapp:date]
>> ...
>
> As far as I recall, the second one should be an invalid query, as you
> have the property on the wrong side of the comparison.
>
> Best regards, Julian
>
>



-- 
Hippo
Europe  •  Amsterdam  Oosteinde 11  •  1017 WT Amsterdam  •  +31 (0)20 522 4466
USA  • San Francisco  185 H Street Suite B  •  Petaluma CA 94952-5100
•  +1 (707) 773 4646
Canada    •   Montréal  5369 Boulevard St-Laurent  •  Montréal QC H2T
1S5  •  +1 (514) 316 8966
www.onehippo.com  •  www.onehippo.org  •  info@onehippo.com

Mime
View raw message