Hi,
I would like to generate cells in a table depending on a variable in
a xml tree.
I get two troubles :
get the number into the jscript procedure (I get a error, probably
due to a format error ? )
the html generated code isn't interpreted (not the right moment to
include that kind of code ?)
I'm newbe in xml/xslt using (it's probably visible :-) , thanks for
your help
JF
_____________________________________________________________
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:utils="http://mycompany.com/mynamespace">
<msxsl:script language="javascript" implements-prefix="utils"><![CDATA[
function col(context, lg ){
var nb = lg;
var i;
var s="";
for (i=0; i<nb; i++){
s += '<td><input type="text" size="1"/></td>';
}
return s;
}
]]></msxsl:script>
<xsl:output method="html" indent="yes"/>
<xsl:template match="racine">
<html>
<head>
<title></title>
</head>
<body>
<p align="center">
<table border="1">
<xsl:apply-templates/>
</table>
</p>
</body>
</html>
</xsl:template>
<xsl:template match="Horizontalement">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="l">
<tr><xsl:apply-templates/></tr>
</xsl:template>
<xsl:template match="m" >
<td> <input type="text" size="1"/> </td>
<xsl:variable name="lg" select="@long"/>
<xsl:copy-of select="utils:col(., $lg)" />
</xsl:template>
<xsl:template match="n">
<td bgcolor="black"/>
</xsl:template>
</xsl:stylesheet>