I have a client application that parses xml responses that are sent from 2 different servers. I call them server A and server B.
Server A responds to one of the request with a response as below:
<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>/T12.txt</D:href>
<D:propstat>
<D:prop>
<local-modification-time xmlns="urn:abc.com:webdrive">1389692809</local-modification-time>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>
Server B responds to one of the request with a response as below:
<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>/T12.txt</D:href>
<D:propstat>
<D:prop>
<O:local-modification-time xmlns:O="urn:abc.com:webdrive">1389692809</O:local-modification-time>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>
If you observer the difference between the two servers, serverA does not send a mapping between namespace and prefix, but serverB does (look at local-modification-time tag). How can I write a generic client parsing logic, to handle both these scenarios generically. Any sample code would be of great help.
Thanks, -Sandeep