[Catalyst] How are you handling multiformat URL

John Napiorkowski jjn1056 at yahoo.com
Wed Nov 29 05:03:52 GMT 2006


--- Jonathan Rockway <jon at jrock.us> wrote:

> John Napiorkowski wrote:
> > According to suggestions for URI best practices,
> such
> > as "http://www.w3.org/Provider/Style/URI.html" you
> > should make your URI for the resource without a
> file
> > extension, since you want to make enduring URI's
> and
> > who knows if HTML will still be popular in 10
> years,
> > right?
> > 
> > Following this thought I might do something like:
> > 
> > FORMAT   URI
> > xhtml    myapp.com/table
> > atom     myapp.com/table?format=atom
> > csv      myapp.com/table?format=csv
> > 
> > Then I can create three different template toolkit
> > views and decide between them when serializing a
> URL
> > based on the format parameter, while making html
> the
> > default.  They all come from the same data, just a
> > different way of seeing it, so they are all
> > 'alternatives' to the one.
> 
> You could do that.  Or you could just provide one
> XML document that
> contains all of your data.  In a web browser, the
> browser would pick up
> whatever's in the xhtml namespace and display that
> as a web page (while
> ignoring what it doesn't understand).  An RSS reader
> would pick up
> everything in the atom (and dc, etc.) namespace as
> metadata, but still
> display the HTML as HTML.  (This takes some careful
> structuring of your
> document, of course, but nothing too drastic.)  You
> can of course use
> other XML namespaces and provide whatever additional
> metadata you need.
>  (And instead of csv, you can export your tabular
> data into the
> opendocument XML format and open it in the OO.org
> spreadsheet.)
> 
> This is especially convenient for users, since they
> can just use one URI
> to refer to one piece of information ("the slashdot
> homepage") instead
> of several URIs to refer to several formats, each
> containing different
> information.
> 
> XML++
> 
> I'm planning on converting Angerwhale's output
> format to this Real Soon
> Now (tm), negating the need for a separate RSS
> section, but I haven't
> had time to do that recently.
> 
> Regards,
> Jonathan Rockway

Seems like a good idea for handling XML type data, I
might also give it a try.  How would you plan to
handle media types, as a <link rel="alternate"
type="image/png" .../> or something similar?

> 
> -- 
> package JAPH;use Catalyst
> qw/-Debug/;($;=JAPH)->config(name => do {
> $,.=reverse qw[Jonathan tsu rehton lre rekca
> Rockway][$_].[split //,
> ";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;
> 
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo:
> http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
>
http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
> 



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com



More information about the Catalyst mailing list