sydron
asked on
XPath 1.0 - Getting maximum and minimum value of a node
Can anyone suggest a clean way of grabbing the maximum and minimum value of an XML document ( say datetime of an event ).
e.g say I have a list of event nodes and I want to grab the min and max event date in the xml.
I can not use XPath 2.0 so any functions that are available for 2.0 to solve this problem can not be used.
Any ideas guys?
e.g say I have a list of event nodes and I want to grab the min and max event date in the xml.
I can not use XPath 2.0 so any functions that are available for 2.0 to solve this problem can not be used.
Any ideas guys?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have to agree with you that it is slower to do this in xpath. I might actually just do it in the application language itself.
I thought of stripping the non digit characters from teh date, but that doesn't work on the nodeset of course,
only option that is elegant enough to maintain seems to me that you get the max and min through application code
only option that is elegant enough to maintain seems to me that you get the max and min through application code
ASKER
Perfect answer.
ASKER
Hope this is what you need.