This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSL

 
alain lacour
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Sham Jowsaki
Ranch Hand
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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>
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic