我試圖通過OpenSearch集成在Windows 7資源管理器中顯示來自IBM Content Analytics的REST API的結果。 REST API爲每個搜索命中返回一個包含<atom:entry>
元素的Atom訂閱源。爲什麼Windows資源管理器不能正確顯示除text/html之外的其他類型的OpenSearch結果?
我的問題是:一旦一個元素的<atom:link>
具有比其他text/html
的值type
屬性,在Windows資源管理器打到相應的搜索顯示爲「無資料」。在下面的最小示例中,只要刪除type="application/msword"
或將其值更改爲text/html
,搜索命中就會正確顯示。
<atom:entry>
<atom:title>Hit B</atom:title>
<atom:link rel="alternate" type="application/msword" href="http://192.168.111.130:8394/api/v10/document/content?collection=Search&uri=file:///C:/DataFiles/Price%2BChange.doc" hreflang="en"/>
<atom:id>file:///C:/DataFiles/Price+Change.doc</atom:id>
<atom:summary>...B</atom:summary>
</atom:entry>
任何人都可以解釋這種現象,或者說如何避免它,並在Windows資源管理器顯示非text/html
結果?
文檔似乎很少,我發現的大部分內容都在以下鏈接的兩個文檔中,但在這個問題上我沒有發現任何內容。
- http://msdn.microsoft.com/en-us/library/windows/desktop/dd940453%28v=vs.85%29.aspx
- http://windowsteamblog.com/windows/b/developers/archive/2010/04/18/windows-7-federated-search.aspx
根據[RFC 4287](http://www.ietf.org/rfc/rfc4287),第4.1.2節,'atom:entry'元素_MUST_至少包含一個'atom:link'元素 - 如此這意味着任何Windows資源管理器都會迫使我不遵守Atom RFC。 我的問題的確是關於爲什麼從'atom:link'元素中去除'type'屬性來修復東西。 – Rich