[uf-discuss] Microformat for linking to XML source (to replace
the Structured Blogging plugin's embedding method)
Mark Pilgrim
pilgrim at gmail.com
Fri Jan 20 11:54:54 PST 2006
On 1/18/06, Charles Iliya Krempeaux <supercanadian at gmail.com> wrote:
> > > No, but <a rel="alternate" type="application/xml">foo</a> is.
> > >
> > > RTFS: http://www.w3.org/TR/REC-html40/types.html#type-links.
> >
> > Excellent - thanks Mark and Ryan! I didn't realise that the "type"
> > attribute was valid on <a> elements.
> >
> > Does that require that we serve the XML with the application/xml MIME
> > type? The spec calls the type attribute an "advisory hint"; I'm not
> > sure whether this means it has to be correct, or only that it has to be
> > close enough (e.g. to text/xml or application/something+xml) to let a
> > reader know that the linked resource is XML.
If the "XML source" has a registered MIME type (like, say,
"application/atom+xml", as defined in RFC 4287):
* Ideally, you should serve the XML source page with the full
registered MIME type.
* If you want to do strange things with the XML source (like being
able to view it in a browser, possibly styled with CSS and/or
transformed with XSL), you are allowed to serve the XML source page
with the general "application/xml" MIME type.
* Either way, you should use the full registered MIME type in the
@type attribute when you link to the XML source. <a rel="alternate"
type="application/atom+xml" href="..."> (substitute the MIME type
you're actually using).
If the "XML source" is just some random XML document in a format that
you made up, or some format that doesn't have a registered MIME type
(like RSS):
* Serve the XML source page as "application/xml". Do *NOT* just make
up a MIME type, unless you know how to do it properly.
* Link to it with <a rel="alternate" type="application/xml" href="...">.
> Wasn't "text/xml" deprecated?! And instead you are suppose to use
> "application/xml" or "application/???+xml", etc. (If I remember
> correctly, this was done because of text-transcoders and conflicts
> between "text types" specified with HTTP and XML. I think I read this
> on Mark Pilgrim's blog... but I couldn't find the article.)
Don't use "text/xml". Ever. Here's why:
http://feedparser.org/docs/character-encoding.html
--
Cheers,
-Mark
More information about the microformats-discuss
mailing list