XML trees in Opera

In modern web browsers it is possible to produce content by writing plain XML and defining the layout of the elements with CSS, even though the XML isn't XHTML or other standardized semantic markup language. Both Opera and Firefox supports this, but unlike Firefox that shows an XML tree when there is no CSS attached to the XML, Opera will simply show the content of the XML elements. But fear not, the solution is here!

The reason Opera behaves like this is because it is a feature in Opera to show content as it appears without CSS, and XML is not treated any different than any other content. Since Enonic Vertical Site depends on the browser functionality to show XML from datasources when previewing them or debugging, this makes using Opera with Enonic Vertical Site a little awkward.

Opera has a functionality called User JavaScript (userjs), which is compatible with the Greasemonkey feature in Firefox. This is basically a JavaScript file that is downloaded onto your computer, and run on web pages that you view. To view XML trees in Opera, we can simply install the XML tree userjs file.

To install it, first create a folder to keep your userjs files in. Next, start Opera and open Preferences (on Mac this is in the menu under Opera on the far left, on other platforms under Tools). In preferences go to Advanced -> Content -> JavaScript Options and add your newly created folder to the field called User JavaScript Files.

Finally, save the userjs for XML trees in the directory created earlier, and restart Opera. That's it!

Comments

19 September 2009 18:14

Commented by Jørund Vier Skriubakken

Yeah! Next line, test.

If you want to comment on this article you need to be logged in.

Published in 2011

2010

2009

2008

2007