Results 1 to 10 of 10

Thread: Displaying Applet with XSLT Problem

  1. #1

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Question Displaying Applet with XSLT Problem

    I'm back with another problem with applets. This time, I'm having trouble displaying applets with XSLT. See I'm usually using an HTML-only page to test my applet out on (I don't like using the applet viewer). Anywho, since I'm trying to get away from making HTML-only pages and using XML technologies instead so I decided to use and XML file transformed by XSLT to display my applet. Well the HTML-only page runs the applet smoothly. The XML file tells me that the applet isn't "inited" and doesn't display it. Can someone give me a hand? I'll display my XML/XSLT code below.

    XML:
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="MonopolyMain.xsl"?>
    <monopolyMain>
            <gameFrame>
                    <codeSource>
                    MonopolyMain.class
                    </codeSource>
                    <frameWidth>
                    430
                    </frameWidth>
                    <frameHeight>
                    430
                    </frameHeight>
                    <frameAlignment>
                    center
                    </frameAlignment>
            </gameFrame>
    </monopolyMain>
    XSLT:
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
    <xsl:template match="/">
         <html>
              <body>
                    <applet code="{gameFrame/codeSource}" width="{gameFrame/frameWidth}" height="{gameFrame/frameHeight}"></applet>
              </body>
         </html>
    </xsl:template>
    </xsl:stylesheet>
    Thanks in advance!

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Displaying Applet with XSLT Problem

    Which browser?
    Have you checked the generated HTML in a standalone transformer? Does it look correct? If it does, it would be a problem of the browser transforming the XML.

    Also, <applet> is an outdated and deprecated method of doing a Java applet, with generally a high chance of failing in IE. Use <object> with the right clsid instead.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Displaying Applet with XSLT Problem

    It worked fine on IE 7 RC1, but nothing showed up on FF. Just a blank page with an empty applet tag, no attributes set
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  4. #4

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Re: Displaying Applet with XSLT Problem

    Also, <applet> is an outdated and deprecated method of doing a Java applet, with generally a high chance of failing in IE. Use <object> with the right clsid instead.
    Thanks for the update. I don't like using deprecated code.

    In regards to <object>, mainly the clsid, how do you obtain that? Is that a randomly generated GUID?

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Displaying Applet with XSLT Problem

    No, it's not random, it's fixed for the Java plugin. No idea what exactly, but a Google search should provide the info.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Re: Displaying Applet with XSLT Problem

    Okay I found out information about the clsid and implemented a very simple object tag that I saw that worked fine in HTML. I modified the XML and XSLT sheets and here's what I have so far:

    XML:
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="MonopolyMain.xsl"?>
    <monopolyMain>
            <gameFrame>
                    <codeSource>
                    MonopolyMain.class
                    </codeSource>
                    <frameWidth>
                    430
                    </frameWidth>
                    <frameHeight>
                    430
                    </frameHeight>
                    <jPlugInClsId>
                    clsid:8AD9C840-044E-11D1-B3E9-00805F499D93
                    </jPlugInClsId>
            </gameFrame>
    </monopolyMain>
    XSLT:
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
    <xsl:template match="/">
         <html>
              <body>
                   <object classid="{gameFrame/jPlugInClsId}" width="{gameFrame/frameWidth}" height="{gameFrame/frameHeight}">
                        <param name="code" value="{gameFrame/codeSource}" />
                   </object>
              </body>
         </html>
    </xsl:template>
    </xsl:stylesheet>
    The browser (IE6SP1) parses both correctly, and all my plugins are up to date, so I'm starting to think it's IE itself. The applet still isn't loading.

  7. #7
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Displaying Applet with XSLT Problem

    I tried it on a newer version and it didn't work
    take a look at this page http://java.sun.com/j2se/1.5.0/docs/...sing_tags.html
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  8. #8

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Re: Displaying Applet with XSLT Problem

    That's the page I had looked at previously. I read over the information again and still the applet will not show. T_T

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Displaying Applet with XSLT Problem

    Does it show if you directly load an HTML file containing the conversion result? If yes, then it's a bug with IE's XML/XSLT handling. (Wouldn't surprise me.) If no, check your Java installation.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  10. #10

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Re: Displaying Applet with XSLT Problem

    Does it show if you directly load an HTML file containing the conversion result? If yes, then it's a bug with IE's XML/XSLT handling. (Wouldn't surprise me.) If no, check your Java installation.
    Yeah it displayed.

    Is there a browser other than IE, Firefox, and Opera, or an application that I can use to see my XML pages that doesn't use up a crap load of memory because that's something that I can't really spare (at only 192MB, WMP kills me T_T and yes it's an old computer with Win2K) and doesn't have IE defects in it? Or will I have to use the memory consuming Firefox?

Posting Permissions

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



Click Here to Expand Forum to Full Width