tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "LANTRES Franck" <Franck.LANT...@fr.renault-sport-f1.com>
Subject Xtags:valueOf problem
Date Thu, 08 Dec 2005 13:16:26 GMT
Hi,

I have created a JSP which displays some graphics.
These graphics depends on user selections.
According to selected values, an XPath expression is created.

As soon as the selected values are strings, all is working fine.
As soon as the user select a range of dates, for exemple from 01/11/2005
to 30/11/2005, the results are wrong. Note that dates are expressed in
milliseconds.

Here is an exemple :
- queried XML document
<LIST_OF_DOCS>
<DOC><NUMBER>1</NUMBER><TYPE>xml</TYPE><DATE>123456789000</DATE></DOC>
<DOC><NUMBER>2</NUMBER><TYPE>xml</TYPE><DATE>134567892000</DATE></DOC>
<DOC><NUMBER>3</NUMBER><TYPE>xsl</TYPE><DATE>145678923000</DATE></DOC>
</LIST_OF_DOCS>

- JSP sample :
<%
  int firstDate = ....;   // = 130000000000, for example
  int lastDate = ....;    // = 150000000000, for example
  String query = "count(/LIST_OF_DOCS/DOC[TYPE='xml' and DATE &gt;= " +
firstDate + " and DATE &lt= " + lastDate + "])";
%>
  <xtags:valueOf select="<%=query%>"/>

The result of this query (<xtags:valueOf select="<%=query%>">) is 2.
In fact, whatever the values of firstDate and lastDate, the result is
always 2.
I tried using the number() function but I get the same results.

Note that if the query is equals to "count(/LIST_OF_DOCS/DOC[DATE &gt;=
" + firstDate + " and DATE &lt= " + lastDate + " and TYPE='xml'])", the
result is equal to 3 !!!!!

Any idea ?

Regards,

Franck

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message