From: Jaydeep A. <jay...@pe...> - 2008-10-22 06:13:23
|
Hello, I have a requirement to compare xml data returned from an api against xml data saved in file. I am using xmlunit for the same. Xml data returned from api - <?xml version="1.0"?><VEHICLE_LIST><SCREEN_NAME>FE601019</SCREEN_NAME><SCREEN_NAME >FE601018</SCREEN_NAME><SCREEN_NAME>CD601015</SCREEN_NAME><SCREEN_NAME>CD601 016</SCREEN_NAME><SCREEN_NAME>CA000382</SCREEN_NAME></VEHICLE_LIST> Xml data from file - <?xml version="1.0"?> <VEHICLE_LIST> <SCREEN_NAME>FE601019</SCREEN_NAME> <SCREEN_NAME>FE601018</SCREEN_NAME> <SCREEN_NAME>CD601015</SCREEN_NAME> <SCREEN_NAME>CD601016</SCREEN_NAME> <SCREEN_NAME>CA000382</SCREEN_NAME> </VEHICLE_LIST> Data from both sources is same except file has extra newline characters <\n>. These characters are also considered during comparison and hence it fails. Any idea as how to bypass new line characters? One option is to read file and skip all new line characters. Thanks Jaydeep DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails. |