The RSS feed generated by Opensearch does not validate with Feedvalidator:
E.g. check out this feed query and see the errors with Feedvalidator:
This feed does not validate.
line 11, column 1: Undefined channel element: opensearch:link [help]
<opensearch:link href="http://humanitariannews.org/opensearch/node" type="a ...
^
In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
line 2, column 0: Use of unknown namespace: http://a9.com/-/opensearch/extensions/relevance/1.0/ [help]
<rss version="2.0" xml:base="http://humanitariannews.org/" xmlns:dc="http:// ...
line 19, column 0: item should contain a guid element (10 occurrences) [help]
</item>
line 87, column 0: Missing atom:link with rel="self" [help]
</channel>
Peter
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 605378.patch | 975 bytes | jpmckinney |
| #2 | 605378.patch | 1.77 KB | jpmckinney |
| #4 | 605378-3.patch | 1.01 KB | jpmckinney |
Comments
Comment #1
jpmckinney commentedTo fix the validation error, we need to change opensearch:link to atom:link according to the specs: http://www.opensearch.org/Specifications/OpenSearch/1.1/Draft_4
However, when generating an RSS feed for a search performed by the apachesolr_search module, this patch will break the feed, as /opensearch/apachesolr_search (which opesearch:link/atom:link link to) returns malformed/nonsense XML (which should be fixed separately). EDIT I can fix the broken feed if apachesolr 6.x-2.x-dev is used. I haven't tried my local edits in apachesolr 6.x-1.x
Comment #2
jpmckinney commentedHere is a patch to fix the Missing atom:link with rel="self" warning.
Comment #3
jpmckinney commentedI've started a thread in the Feed Validator Google group regarding the Use of unknown namespace warning.
http://groups.google.com/group/feedvalidator-users/browse_thread/thread/...
Comment #4
jpmckinney commentedTo add a guid, I implement the recommendation on http://diveintomark.org/archives/2004/05/28/howto-atom-id
Patch attached.
Comment #5
avpadernoThe patch is not in the correct format; the patch should be applied from the directory containing the project files, but even fixing the paths, I get an error message
patch: **** unexpected end of file in patch.Comment #6
avpadernoThe code has been changed, and committed in CVS.
Thanks for the report, and the patch.
Comment #7
jpmckinney commentedMy patch naming convention is perhaps confusing.
None of the three patches I submitted (in #1, #2, and #4) are related to each other. Each fixes one validation error/warning.
#1 needs work. It solves the validation error, but exposes a deeper bug in the opensearch module. It should not be applied yet.
#2 is a useful patch that fixes the Missing atom:link with rel="self" warning.
#4 was applied to dev. thanks!
Comment #8
avpadernoI guess that I should have then applied first #3, and then #4. I am sorry; I thought that the newest would replace the older, as it is usually done.
I will apply also the other patch, or change the code manually, if it doesn't work. Actually, as I am changing the code to fix some problems it has (misuse of
t(), etc), the patch will now not apply anymore; I think I should still be able to change the code following the patch you provided.Comment #9
dave reidJust committed changes that made the search results RSS valid (expect for the odd validation errors that were pointed out earlier that we cannot fix).
http://drupal.org/cvs?commit=306468
Results I got from were:
The error on line 11 is because I copied and pasted the XML instead of giving it a location (source is on localhost).
Comment #10
dave reidI also removed that complex GUID calculation because it was causing PHP notices when search results do not have a date (like with users, etc). Doing
<guid isPermaLink="false">http://mysql.drupal6dev.local/node/1</guid>is perfectly valid and simple for now.http://drupal.org/cvs?commit=306448
Comment #11
jpmckinney commentedAs you are no longer using a tag: URI for the guid, you may remove isPermaLink="false".
To answer the @todo in the commit previous to http://drupal.org/cvs?commit=306448, the regex is transforming the permalink into a tag: URI: http://en.wikipedia.org/wiki/Tag_URI