0

I have an xml file..for this xml file i need to compare the data with the tags in xml file with the tags in website using java ?

<IRInfo>
    <protocolNumber>N/A</protocolNumber> 
    <studyTypes>Prospective and Randomized controlled trial</studyTypes> 
    <enrollmentCount>No.of subjects to be recruited at local site: 68</enrollmentCount>
    <diseaseGroup>Endocrine system</diseaseGroup> 
    <rawStartDate>Feb2004</rawStartDate> 
</IRInfo>

Now for this I need to compare the raw start date data present in xml with website...

Michaël Azevedo
  • 3,874
  • 7
  • 31
  • 45
Rhino 0419
  • 29
  • 2
  • if you need a lot of data/all data from your XML and it has a predefined structure - you could look into JAXB. If you only need the value of one tag/a few tags or your XML has not a predefined structure - you could look into [x-Path](http://stackoverflow.com/questions/2811001/how-to-read-xml-using-xpath-in-java) – Rhayene Mar 15 '16 at 09:03
  • Btw. from you question I'm not sure if your problem lies in parsing values from your XML or getting values from your website or the comparison of these values. – Rhayene Mar 15 '16 at 09:10
  • @Rhayene I need to compare the format of raw start date in the xml corresponding to the same tag in the website . I have a specific format of comparison as mmm yyyy. It means that the same format should be present in xml as well as the website... If it is true then i should get it is correct else i should get wrng msg... – Rhino 0419 Mar 15 '16 at 09:45
  • well you need to parse the tag value from the xml (you can use x-Path for example) and parse the tag value from the html - look at [this](http://stackoverflow.com/questions/4595770/how-to-get-a-value-from-html-file-in-java) and then [compare the dates](http://stackoverflow.com/questions/10609596/comparing-date-strings-in-java) – Rhayene Mar 15 '16 at 09:56

0 Answers0