This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Problem in XPath while using index such as //day[7] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Problem in XPath while using index such as //day[7]" Watch "Problem in XPath while using index such as //day[7]" New topic
Author

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

Mahendran Aiyappan
Ranch Hand

Joined: Sep 05, 2005
Posts: 102
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

Joined: Oct 14, 2005
Posts: 19719
    
  10

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.
 
Have you checked out Aspose?
 
subject: Problem in XPath while using index such as //day[7]
 
It's not a secret anymore!