Meaningless Drivel is fun!*
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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in XPath while using index such as //day[7]