2 つの異なるサーバーから送信された xml 応答を解析するクライアント アプリケーションがあります。私はそれらをサーバーAとサーバーBと呼んでいます。
サーバー A は、次のような応答で要求の 1 つに応答します。
<?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>
サーバー B は、次のような応答で要求の 1 つに応答します。
<?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>
2 つのサーバーの違いを観察すると、serverA は名前空間とプレフィックスの間のマッピングを送信しませんが、serverB は送信します (local-modification-time タグを見てください)。これらの両方のシナリオを一般的に処理するために、一般的なクライアント解析ロジックを作成するにはどうすればよいですか。サンプルコードは非常に役立ちます。
ありがとう、 -サンディープ