Hi again

Thanks for the suggestions.

I found a simple solution to this.

As a reference I'll rephrase the challenge:

- I want to make any search in my application have a corresponding Atom feed
- The application uses query parameters: ?param1=value1&param2=value2...
- The feed ID should be the same for any searches wich are equivalent.
  parameter permutations can give several equivalent searches:
  ?param1=value1&param2=value2
  ?param2=value2&param1=value1
- I want to mint an Atom feed ID using the Tag URI scheme
- The feed ID should be easy for humans to read

I first looked at the Tag URI scheme, and found how to mint the ID.
Ref http://taguri.org/
tagURI = "tag:" taggingEntity ":" specific

The first parts were easy:
tag:duo.uio.no,2009-09:

The specific part was the challenge.

The Atom specification was not a great help:
http://tools.ietf.org/html/rfc4287#section-4.2.6

I first decided on using a normal query syntax:
search?param1=value1&param2=value2

The problem is that the ampersands are escaped to make the ID-string valid XML content, which makes an ugly, long and difficult to read ID (a search can typically have 6 parameters).

The sollution was in http://en.wikipedia.org/wiki/URI_scheme
where semicolon is suggested as a parameter delimiter in the query, exactly to avoid the problem with & in the query string.

(I now know that this was suggestes by Tim Berners-Lee as early as in 1995 in Hypertext Markup Language - 2.0, ref http://tools.ietf.org/html/rfc1866 section 8.2.1)

We'll use the following feed ID scheme:
tag:duo.uio.no,2009-09:search?param1=value1;param2=value2

To make sure that equivalent searches have the same feed-ID, I remove any unnecessary parameters (like format=atom) and sort the parameters before minting the feed ID.


Best Regards,
Are D. Gulbrandsen
The XML-group,
Center for Information Technology Services
University of Oslo

Reply via email to