• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XSL

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Does somebody know how to create a xsl file
producing the following html file:
<html>
<applet code="GraphApplet.class" codebase="classes" archive="GraphChart.jar" width="900" height="500">
<param name="showborder" value="yes" />
</applet>
using the above source XML file:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<applet code="GraphApplet.class" codebase="classes" archive="GraphChart.jar" width="900" height="500">
<param name="showborder" value="yes" />
</applet>
Thank's for your help.
Regards
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
test.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<applet code="GraphApplet.class" codebase="classes" archive="GraphChart.jar" width="900" height="500">
<param name="showborder" value="yes" />
</applet>
test.xsl
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<applet code="GraphApplet.class" codebase="classes" archive="GraphChart.jar" width="900" height="500">
<param name="showborder" value="yes" />
</applet>
</html>
</xsl:template>
</xsl:stylesheet>
Now you call the xml file in the browser you will get the result.
Cheers
JOwsaki
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But you hardcode all XML tags inside XSLT!
How about this instead:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="node()">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="/">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>
</xsl:stylesheet>
 
alain lacour
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
may be I didn't explain correctly what I was looking for:
I needed to sort it out like this:

<!-- applet -->
<xsl:stylesheet
version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl utput method='html' indent='yes'
doctype-public='-//W3C//DTC HTML 4.0 Final//EN'/>
<xsl:template match='applet'>
<h3 align="left" style="text-align:left"><u>Suivi graphique des appels:</u></h3>
<p>
<blockquote>
<APPLET>
<xsl:attribute name="code"><xsl:value-of select='@code'/></xsl:attribute>
<xsl:attribute name="codebase"><xsl:value-of select='@codebase'/></xsl:attribute>
<xsl:attribute name="archive"><xsl:value-of select='@archive'/></xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select='@width'/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select='@height'/></xsl:attribute>
<br/>
<xsl:for-each select="param">
<PARAM>
<xsl:attribute name="NAME">
<xsl:value-of select='@name'/>
</xsl:attribute>
<xsl:attribute name="VALUE">
<xsl:value-of select='@value'/>
</xsl:attribute>
<br/>
</PARAM>
</xsl:for-each>

</APPLET>
</blockquote>
</p>
</xsl:template>
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic