• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in XPath while using index such as //day[7]

 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

First I will present the XML file.



The week is going to repeat another 4 times.

I need to find all the day as well as using index.


The problem for me is it is working for one week, that means the currentDay value is working from 1 to 7.

For the next week the currentDay will be greater than 7 it is not able find the element(day).

Can anybody give me any alternative XPath expression for this situation.

Thanks for your comments.
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay... does that mean that the actual XML document has 35 <day> elements, and you want to select the ones with number="7"? Or does it mean that you need to convert the day of the month to the day of the week? Or does it mean something else? I think you should clarify your requirements before you start implementing them.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic