Java: Reading the LAST entry from an xml file

hesbecoglay

New Member
So I have a project where I need to pull an xml file that is updated every 5 minutes. However I'm designing my program to pull this file every time it updates.The data structure of the xml file is like this...\[code\]<m:REPORT_DATA> <m:DATA_ITEM>ENC</m:DATA_ITEM> <m:RESOURCE_NAME>DLAP</m:RESOURCE_NAME> <m:OPR_DATE>2012-06-02</m:OPR_DATE> <m:INTERVAL_NUM>1</m:INTERVAL_NUM> <m:VALUE>16.77734</m:VALUE></m:REPORT_DATA><m:REPORT_DATA> <m:DATA_ITEM>ENC</m:DATA_ITEM> <m:RESOURCE_NAME>DLAP</m:RESOURCE_NAME> <m:DATE>2012-06-02</m:OPR_DATE> <m:INTERVAL_NUM>2</m:INTERVAL_NUM> <m:VALUE>16.77739</m:VALUE></m:REPORT_DATA>....\[/code\]Assuming that I pull it for the 200th time that day, how would I grab just the last value \[code\]"<m:VALUE>16.77739</m:VALUE>"\[/code\]And get that value for my database?I'm torn about using Sax, Xpath, or DOM. Some help would be amazing.
 
Back
Top