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!
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.
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
Re: Displaying Applet with XSLT Problem
Quote:
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?
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.
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.
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
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
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.
Re: Displaying Applet with XSLT Problem
Quote:
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?