Results 1 to 3 of 3
  1. #1
    scotter59 is offline Member
    Join Date
    Jun 2008
    Posts
    13
    Rep Power
    0

    Default 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
    ----------------------------------------------

  2. #2
    scotter59 is offline Member
    Join Date
    Jun 2008
    Posts
    13
    Rep Power
    0

    Default

    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 ?
    • ?

  3. #3
    scotter59 is offline Member
    Join Date
    Jun 2008
    Posts
    13
    Rep Power
    0

    Default

    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

  1. Hwlp with "Open", "Save", "Save as..."
    By trill in forum New To Java
    Replies: 3
    Last Post: 11-02-2010, 09:26 AM
  2. <core:forEach var="" begin="+<%=j%>+">???
    By freddieMaize in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-27-2008, 01:20 AM
  3. Replies: 5
    Last Post: 05-14-2008, 01:43 PM
  4. "Jumble" or "Scramble" Program
    By Shadow22202 in forum Java Applets
    Replies: 8
    Last Post: 04-30-2008, 03:42 AM
  5. Replies: 1
    Last Post: 07-25-2007, 10:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •