xpath - Get the latest date in the Xpath1.0 -
I have a requirement where I need the latest date from XML below. In Expath 2.0, there is a function named Maximum () but using Xpath1.0
. & Lt; Information & gt; & Lt; Date & gt; 2014-04-21 & lt; / Date & gt; & Lt; / Info & gt; & Lt; Information & gt; & Lt; Date & gt; 2014-05 -05 & lt; / Date & gt; & Lt; / Info & gt; & Lt; Information & gt; & Lt; Date & gt; 2014-04-28 & lt; / Date & gt; & Lt; / Info & gt; Expected output: 2014/05/05 (day / month / year) Any inputs ?? Actually there is a small change in my XML, following my XML (additional parent node is added).
& lt; Custom Content & gt; & Lt; Information & gt; & Lt; Name & gt; ABC & lt; / Name & gt; & Lt; Date & gt; 2014-04-21 & lt; / Date & gt; & Lt; / Info & gt; & Lt; Information & gt; & Lt; Name & gt; Def & lt; / Name & gt; & Lt; Date & gt; 2014-05-05 & lt; / Date & gt; & Lt; / Info & gt; & Lt; Information & gt; & Lt; Name & gt; GHI & lt; / Name & gt; & Lt; Date & gt; 2014-04-28 & lt; / Date & gt; & Lt; / Info & gt; & Lt; / CustomContent & gt;
Now here's Xpath to find the maximum date for XML.
// CustomContent / info / date [not (text () of
thanks to all :)
Comments
Post a Comment