I am a newbie and has attempted to have a go with xml transformation. And I've made a slightly modified version of AppletXMLtoHTML which were included in Xalan-J2_3_0/examples folder.
My problem is that if you comment out alert() within transform() function, it does not render the html page. Ideally alert box will not pop up when the page is loaded along with other information on the page. Has anyone can think of workaround with this? Xara === XSL === <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <html> <head><title>My news</title> <style type="text/css"> a.headline {color:#003399;font-family:verdana;font-size:11px} a.headline:hover {color:#6699cc;text-decoration:none} .source {color:#003399;font-family:verdana;font-size:10px} a.source_url {color:#003399;font-family:verdana;font-size:10px;text-decoration:none} a.source_url:hover {color:#6699cc} </style> </head> <body bgcolor="#ffffff"> <xsl:apply-templates select="moreovernews"/> </body> </html> </xsl:template> <xsl:template match="moreovernews"> <xsl:apply-templates select="article"/> </xsl:template> <xsl:template match="article"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="source"> <strong><a class="headline" href="{url}"><xsl:value-of select="headline_text"/></a></strong><br /> <a class="source_url" href="{document_url}"><xsl:value-of select="source"/></a> <xsl:value-of select="harvest_time"/> </td> </tr> </table><img src="1x1.gif" width="1" height="9" alt="" border="0" /><br /> </xsl:template> </xsl:stylesheet> === HTML === <!doctype HTML public "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <script language="JavaScript"> /* function writeTarget(targetString) { var doc=document; doc.open(); doc.write(targetString); doc.close(); } */ function transform() { //var xmlSource=document.xmlTransform.xmlSourceList.value; //document.xslControl.setDocumentURL(xmlSource); alert(); // if you comment out this line, it will not render! var targetString=document.xslControl.getHtmlText(); // writeTarget(targetString); document.write(targetString); } </script> <body bgcolor="#cccccc" text="#006699"> <applet name="xslControl" code="org.apache.xalan.client.XSLTProcessorApplet.class" archive="../../bin/xalan.jar,../../bin/xml-apis.jar,../../bin/xercesImpl.jar,../../bin/xerces.jar" height="0" width="0"> <param name="documentURL" value="http://p.moreover.com/cgi-local/page?c=Consumer%3A%20natural%20health%20news&o=xml"/> <!-- default setting--> <param name="styleURL" value="news.xsl"/> </applet> <img src="rabbitwhorn.jpg" width="76" height="104" alt="" border="0"><br><br> <script language="JavaScript"> transform(); </script> </body> </html> __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
