aspose file tools*
The moose likes XML and Related Technologies and the fly likes XSL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSL " Watch "XSL " New topic
Author

XSL

alain lacour
Greenhorn

Joined: Aug 17, 2001
Posts: 2
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

Joined: May 22, 2001
Posts: 146
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

Joined: Aug 26, 2000
Posts: 10065
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>


Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
alain lacour
Greenhorn

Joined: Aug 17, 2001
Posts: 2
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
 
subject: XSL