This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • 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
Pie
Posts: 20764
30
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic