Results 1 to 3 of 3
- 07-15-2008, 02:38 AM #1
Member
- Join Date
- Jun 2008
- Posts
- 13
- Rep Power
- 0
Viewing XML using Default Browser - Java's "Desktop" API
I am using Java's "Desktop" API to open the default browser to view an XML file. The file has an associated "XSL" so with some browsers, IE and Firefox, it would be rendered with HTML formatting. This works in Windows 2000 and up until recently it worked in Linux on KDE 3.x. Now however it only opens up Konqueror browser, which does not render the "XML/XSL". I have gone into the "KDE Configure", "Component Chooser", "Web Browser" changed the "Default Component" to Firefox (mozillafirefox). "File Associations", "text", "html" and "xml" putting Firefox at the top of the list, still Konqueror browser displays the XML file, not Firefox. If the KDE user clicks on the XML file in the Konqueror File Manager the default browser is Firefox and the XML/XSL is rendered and displayed.
KDE version: 3.5.8 "release 22.3"
Release: 2.6.18.8-0.1-default
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22
System: Linux version 2.6.18.8-0.1-default running on i386; UTF-8; en_US (nb)
Tested using the code from the following example (add the link protocol):
xxxxx://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/]Using the Desktop API in Java SE 6
Results:
Windows 2000 - works opening using default browser IE
Linux/KDE - does NOT work Opens the XML using Konqueror (default is Firefox) and without the rendering ?
Is there some other "Desktop" setting that needs to be configured ?
I have a sample XML and XSL file I used to test with the code above - this site will not allow links to be entered.
----------------------------------------------
simple.xml
----------------------------------------------
----------------------------------------------
simple2a.xsl
----------------------------------------------
- 07-16-2008, 11:18 PM #2
Member
- Join Date
- Jun 2008
- Posts
- 13
- Rep Power
- 0
Code example replace the "xxxxx" with "http"
xxxxx://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/
Interesting:
- I have a unique feature (Java / KDE / Linux) that results in it always defaulting to the Konqueror Browser ?
- No one else has tried to render an XML / XSL in the default browser using the Desktop API ?
- ?
- 01-29-2009, 07:17 PM #3
Member
- Join Date
- Jun 2008
- Posts
- 13
- Rep Power
- 0
If it is of any interest I modified the code found on this post macosx.com/forums/mac-os-x-system-mac-software/274165-how-do-you-invoke-default-browser-java.html How do you invoke the default browser in Java - macosx.com - How do you invoke the default browser in Java the MacOsX forum references sourceforge.net/projects/browserlaunch2/ BrowserLauncher2 - SourceForge.
Disappointed in Java's Desktop API ability to render XML using XSL and the "solutions" provided here. Geez this is a tacky technical forum - limited posts cannot reference links and cannot provide solutions. Guess this is one of those chit chat forums. Solved this some time ago, figured that I would do the professional thing and provide a solution in case anyone had problems with rendering XML documents in their browser through Java. :rolleyes:
Similar Threads
-
Hwlp with "Open", "Save", "Save as..."
By trill in forum New To JavaReplies: 3Last Post: 11-02-2010, 09:26 AM -
<core:forEach var="" begin="+<%=j%>+">???
By freddieMaize in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 09-27-2008, 01:20 AM -
[SOLVED] Exception in thread "main" java.util.NoSuchElementException
By thevoice in forum New To JavaReplies: 5Last Post: 05-14-2008, 01:43 PM -
"Jumble" or "Scramble" Program
By Shadow22202 in forum Java AppletsReplies: 8Last Post: 04-30-2008, 03:42 AM -
Error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
By romina in forum New To JavaReplies: 1Last Post: 07-25-2007, 10:55 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks