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 XML stylesheet and W3C standard implementation
Date Tue, 22 Jan 2008 22:11:43 GMT
Hello all,

I am trying Abdera to generate Atom documents through servlets.

So far, I am quite happy with this API.

Then, I wanted to associate an Atom XML document with a stylesheet
through an XML preprocessing instruction.

I found  the Document.addStylesheet() method. However, I am not sure
its comportment is standard.

Its interface is:
void addStylesheet(java.lang.String href, java.lang.String media);

But according to http://www.w3.org/TR/xml-stylesheet/ the "media"
attribute seems to be optional on one hand; on another hand, the
"type" attribute seems to be required. I have done some tests with
Safari and Firefox: they cannot process an XML document with its
associated XSL stylesheet if the "type" attribute is not here.

So instead of using addStylesheet, I am using
Document.addProcessingInstruction() to forge a correct XSL
preprocessing instruction.

A patch is quite easy to do, but it would break the compatibility with
the current interface: personnaly, I would change
void addStylesheet(String href, String media)
void addStylesheet(String href, String type)
and possibly add a
void addStylesheet(String href, String type, String media)

But mayhaps I missed a point, so I just wanted to talk about that here
in order to know if there is a problem with the W3C standard or not.
If you think there really is a problem, I will submit a patch or open
a bug report.


V. Hiribarren

View raw message