I've been experimenting with the use of rel="stylesheet" to provide a
relatively safe way of attaching styles to syndicated content.  The
dangers of allowing embedded styles in syndicated content are well known
[1], however, it still makes sense to provide an optional way of
allowing publishers and consumers to attach style to content.

<entry>
  ...
  <link rel="stylesheet" type="text/css" href="hcard.css" />
  <content type="xhtml">
    <div xmlns="..." class="vCard">
      <a class="url fn" href="...">John Doe</a>
      <div class="org">Foo, Inc.</div>
    </div>
  </content>
</entry>

<entry>
  ...
  <link rel="stylesheet" type="application/xslt+xml" href="..." />
  <content type="application/xml">
    <a xmlns="urn:foo">
      <b>
        <c>foo</c>
        <d>bar</d>
      </b>
    </a>
  </content>
</entry>

Consumers could choose to apply or ignore the style... preferably based
on user choice.

[1]http://diveintomark.org/archives/2003/06/12/how_to_consume_rss_safely

James Yenne wrote:
> My feeds contain a generic xml-stylesheet, which formats the feed for
> display along with a feed-specific css.  Since xsl processors do not
> have a standard way to pass parameters to xsl stylesheets, I provide
> this feed-specific css to the xsl processor in the feed as a link with
> rel="stylesheet".  Generating xhtml with this xsl/css solution works for
> rendering both in IE6 and FF1.5.  (Why does IE7 rip out xml-stylesheet
> directives?) 
>  
> A link rel="stylesheet" seems to be the most efficient solution,
> however, a fully qualified URI relation does the job too.  I would like
> to request a stylesheet link relation be added to the IANA List of
> Relations and supported in the validators.  Thoughts? 
>  
> Thanks,
> James

Reply via email to