tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Doubt Regarding Xtags
Date Mon, 20 Aug 2001 10:50:44 GMT
It could be that downloading the latest dom4j release might fix your problem.

  ----- Original Message ----- 
  From: B.Paramagurusamy 
  Sent: Monday, August 20, 2001 11:10 AM
  Subject: Doubt Regarding Xtags 


      Here is my address.xml file 

  Here is my jsp file

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

FWIW the $sex and $city expressions in the <xtags:forEach> tag below will find the parameter
values automatically. Declaring a local "sex" and "city" java instance variables is unnecessary.
The $foo in XTags will try find a page, request, session, application scope attribute first
called "foo" otherwise it will look for a request parameter called "foo".

Also are you sure that $sex and $city are valid matches? Printing out in your JSP something

sex: <xtags:valueOf select="$sex"/>
city: <xtags:valueOf select="$city"/>

might help to check what the values of these parameters are.


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

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

  The above code should display the elements of sex=Male
  and city = 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.

  Trinity Infosys India Pvt.Ltd.,
  #6,Wallace Garden,2nd street,
  Chennai-600 006
  Ph : 91-44-8207199/203/204 (Office)
         91-44-8572701,8525693 (Res)
  E-Mail :
  Visit me at :

View raw message