I have below XML:
< measCollecFile>
< fileHeader>
< measCollec beginTime="2013-03-14T12:10:00+00:00" />
</ fileHeader>
< measData>
< measInfo>
< granPeriod duration="PT300S" endTime="2013-03-14T12:15:00+00:00" />
< measType>VS.ave</measType>
< measType>VS.aveCPU</measType>
< measValue>VS1</measValue>
< measValue>VS2</measValue>
</ measInfo>
</ measData>
</ measCollecFile>
Q: My Problem I need to process this XML file and modify few data in certain Elements. I am able to do that with the help of this site as you can see from my previous posts.
There is a new challenge. as you can see there is datetime element in the XML as well. And I need to update this to the current datetime in the same format as it appears in the XML. i.e. the XML will always contain any date and I just to find the datetime tag and update it to the current datetime but it should be in the same format as it is in there.
Shall I take it as separate issue and treat as simple regex Perl problem and resolve accordingly as a flat file find and replace problem?
or LIBXML has anything built into to identify the datetime Tag and update it with latest datetime?
See Question&Answers more detail:os