abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Hiribarren" <vincent.hiribarren+abd...@gmail.com>
Subject Re: XML stylesheet and W3C standard implementation
Date Fri, 25 Jan 2008 08:09:06 GMT
On Jan 23, 2008 12:22 AM, James M Snell <jasnell@gmail.com> wrote:

> The challenge with PI's is that there actually is no single correct
> syntax for them.  There's just the target and the value.  Whether or not
> the value is structured depends entirely on the target.

I understand your point.

However, if it does entirely depends on the target, to my mind, the
best shot would be to stay compliant with the standards. It would not
be so if not implementing the standards would make the code more
compliant with the current PI processors.

In http://www.w3.org/TR/xml-stylesheet/  it is said that "href" and
"type" are required, but "media" is optional.

> To associate an xml-stylesheet PI with a feed, you need to do it like this:
>
>    Abdera abdera = Abdera.getInstance();
>    Feed feed = abdera.newFeed();
>    Document doc = feed.getDocument();
>    doc.addProcessingInstruction(
>      "xml-stylesheet",
>      "href=\"foo.css\" type=\"text/css\"");
>    doc.writeTo(System.out);

I did something like that. I went into Abdera code and I found that
addStylesheet() was just using addProcessingInstruction().

But to be sure we understand one each other, I was speaking about XSLT
stylesheets (not CSS ones), so to generate a PI instruction like the
following one: <?xml-stylesheet href="project.xsl" type="text/xsl"?>

> Keep in mind also that IE7 and FF 2.x will likely ignore the stylesheet.

Mmmh, I do not know about IE7, but Firefox 2.x (and the latest Safari)
correctly interpret my XSLT stylesheet if I set a xml-stylesheet PI in
an XML document - but only if there is a "type" instruction (like
type="text/xsl"), the "media" one (like media="screen") was useless.

Mime
View raw message