tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "B.Paramagurusamy" <par...@trinitymobile.com>
Subject Doubt Regarding Xtags
Date Mon, 20 Aug 2001 10:10:00 GMT
Hi,

    Here is my address.xml file 
   -------------------------------------------
      <addressbook>
            <address>
                  <id>1</id>
                  <name>Guru</name>
                  <city>Chennai</city>
                  <sex>Male</sex>
           </address>
            <address>
                  <id>2</id>
                  <name>Samy</name>
                  <city>Chennai</city>
                  <sex>Male</sex>
           </address>
            <address>
                  <id>3</id>
                  <name>Sasi</name>
                  <city>Chennai</city>
                  <sex>FeMale</sex>
           </address>
      </addressbook>

Here is my jsp file
--------------------------

String sex=request.getParameter("sex"); // getting sex as Male
String city=request.getParameter("city"); // getting city as Chennai

<xtags:parse uri="xml/address.xml"/>
<table columns="3">

<tr>
         <td>id</td>
         <td>Name</td>
         <td>city</td>
         <td>sex</td>
</tr>
<xtags:forEach select="//address[sex=$sex and city=$city]">
<tr>
     <td><xtags:valueOf select="id"/></td>
     <td><xtags:valueOf select="name"/></td>
     <td><xtags:valueOf select="city"/></td>
     <td><xtags:valueOf select="sex"/></td>
</tr>
</xtags:forEach>
</table>

The above code should display the elements of sex=Male
and city = Chennai.ie.it should display 2 records..
But i found no display..The 'and' operator is not working..
But in xsl the same code is working..In terms of xtags i found
this difficulty..Anything wrong in my code..Pls.rectify.

Regards,
Paramagurusamy.
                 
-------------------------------------------------------------------
Trinity Infosys India Pvt.Ltd.,
#6,Wallace Garden,2nd street,
Nungambakkam,
Chennai-600 006
Ph : 91-44-8207199/203/204 (Office)
       91-44-8572701,8525693 (Res)
E-Mail : paramu1977@yahoo.com
Visit me at : http://balder.prohosting.com/paramu
-----------------------------------------------------------------------


Mime
View raw message