Thursday, June 22, 2006

 

Opera 9 ships, but still fails in its support of xml

The Opera browser has often been praised for its standards support, and with the release of the latest version, Opera 9, I had hoped that it may have added good support for xml.

Although web browsers are primarily used to browse HTML formatted documents, they can also be used to view a number of other types of documents. Foremost amongst these are xml documents, a close relative of HTML documents, but in many ways far more powerful - that x stands for Extensible. Viewing a raw xml file is rarely the best way to do it, so xml files are generally viewed with the aid of a stylesheet - written in xsl (Extensible Stylesheet Language), and the the process of transforming the xml into a viewable form is known as XSLT.

The Opera 9 spec document states that

XML support

Opera can parse and display XML documents. Opera can be both a validating and non-validating processor.

Documents with Content-type "text/xml", "application/xml" or with a subtype ending on "+xml" will be treated as an XML document. If a Content-type is not available, the ".xml" file extension will also make the document be treated as XML. Opera does not use US-ASCII as the default character set for text/xml, but otherwise follows RFC3023. We recommend using application/xml instead of text/xml or use explicit character set declaration.

XSLT, XPath, and XSL-FO

Opera has near-complete support of XSLT 1.0 and XPath 1.0

Opera does not support XSL Formatting Objects.

It sounds from that as if the support of xml is pretty extensive, but in practice there's aparently a lot of flexibility in those words. The "near-complete support of XSLT 1.0" seems to mean that they don't support the vitally important document() function - which rather takes the teeth out of XSLT. The document() function reads xml from a named document URL, making the XSLT process powerful, allowing it to pull information in from a number of xml documents. Consider a page of product information that pulls in current prices from a specific price document, and stock levels from another document.

(The previous version, Opera 8, had no support of XSLT, so partial support might sometimes be considered an improvement. However, in many cases its a step backwards - in Opera 8, since the XSLT instructions associated with a xml file are ignored, at least you get to see the raw xml data. In Opera 9, it starts to process the file, but fails on an unsupported base feature, so nothing but an error message is displayed).

Without fully supporting XSLT 1.0, Opera languishes a long way behind the other browsers in supporting xml - IE 6 has great support for XSLT, as does the Mozilla / Firefox family (if a little slow at times).

Update: A fascinating interview on Slashdot, with Håkon Wium Lie of Opera. He notes that:
From that perspective, it makes sense to leave ### half-implemented. You can claim support (and many journalists will believe you), and you also ensure that no-one can use the unimplemented (or worse: buggily implemented) features of the standard. The only way to change the equation is to remind ### how embarrassing it is to offer a sub-standard browser. And to use better browsers.
How true this is - the sentence could so easily apply be completed with XSLT and Opera filling in the gaps. Actually, the published quote was about CSS2 and Microsoft!

Håkon Wium Lie was the father of CSS, and I think reading the whole article gives an insight into the thinking at Opera - they view CSS as all important, and are happy to let XML and XSLT take a back seat. This also comes through across in another reply, which notes

... CSS is an intrinsic component of AJAX. The "AJAX" name sounds great, but allow me to propose a few alternate spellings that I find more accurate:

  • AJACX: Asynchronous JavaScript, CSS and XMLHttpRequest
  • ADJACS: Asynchronous DOM, JavaScript and CSS
  • ADHJACS: Asynchronous DOM, HTML, JavaScript and CSS
  • AJAHCS: Asynchronous JavaScript, HTML and CSS
  • AJACS: Asynchronous JavaScript, HTML and CSS

Comments: Post a Comment



<< Home