This should work:

<%@ page contentType="text/plain" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"; %>
<%@ taglib prefix="x"   uri="http://java.sun.com/jstl/xml"; %>

<x:parse var="xml">
  <!-- XML here -->
</x:parse>

<jsp:useBean id="today_notformated" class="java.util.Date"/>
<fmt:formatDate var="today"
                value="${today_notformated}"
                pattern="yyyy-MM-dd"/>

<x:forEach select="$xml//[EMAIL PROTECTED]">
    <x:out select="./@datum"/>
</x:forEach>

Which should give:

2003-11-07

Quoting Stefan Trcko <[EMAIL PROTECTED]>:

> Hello
> 
> I have an XML file with content listed below:
> 
> - <dan datum="2003-11-06">
> - <spored kino="Planet Tus Celje">
> - <film id="282" language="sl">
>   <naslov_si>Ameriska pita: poroka</naslov_si> 
>   <naslov_en>American Pie 2</naslov_en> 
>   <zvrst>Komedija</zvrst> 
>   <url>http://www.planet-tus.com/film.php?id=282</url> 
> - <predstava>
>   <ura cena="900">15:30</ura> 
>   <ura cena="900">18:40</ura> 
>   <ura cena="900">20:50</ura> 
>   </predstava>
>   </film>
> </spored>
> </dan>
>  <dan datum="2003-11-07">
> - <spored kino="Planet Tus Celje">
> - <film id="282" language="sl">
>   <naslov_si>Ameriska pita: poroka</naslov_si> 
>   <naslov_en>American Pie 2</naslov_en> 
>   <zvrst>Komedija</zvrst> 
>   <url>http://www.planet-tus.com/film.php?id=282</url> 
> - <predstava>
>   <ura cena="900">15:30</ura> 
>   <ura cena="900">18:40</ura> 
>   <ura cena="900">20:50</ura> 
>   <ura cena="900">23:00</ura> 
>   </predstava>
>   </film>
> </spored>
> </dan>
> 
> This is mys jsp file:
> <%
> 
> Datum datum = new Datum(); 
> 
> Date today_notformated = new Date();
> 
> String today = datum.formatiraj_datum(danasnjiDatum,"yyyy-MM-dd");
> 
> <!--today_notformated is formated to year-month-day-->
> 
> %>
> 
> <tl:forEach select="//dan">
> 
> <tl:choose>
> 
> <tl:when test="@datum=$today">
> 
> <TR>
> 
> <TD>
> 
> <tl:valueOf select="@datum"/>
> 
> </TD>
> 
> </TR>
> 
> .....
> 
> I want to print out only the data for the current date, but when I test
> <tl:when test="@datum=$today">, the test doesn't work.
> Any suggestions?
> 
> Thanks,
> Stefan

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to