xsl-list
[Top] [All Lists]

Re: html code generation & parameter between xslt and jscript

2005-02-28 11:09:29
Sorry again for my too long preceding message !
Could I have a response with this shorter one ?
I try for a long time to get this parameter in JScript, and I don't understand why the inserted code isn't interpreted as html

Johnnie Fox a écrit:

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>


______________________________________________________________
<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type="text/xsl" href="mcroisés.xsl"?>
<racine>
<Horizontalement>
<l name="1">
<m long="12">Célèbre restaurateur de Saint-Germain-des-Près. </m>
<n/>
<m long="7">Croquait le marmot à Montmartre.</m>
</l>
<l name="2">
<m long="11">Imposer ses convictions.</m>
<n/>
<m long="8">Alençon ou Orléans, Provence ou Artois.</m>
</l>
<l name="3">
<m long="4">Peut faire peur aux enfants. </m>
<n/>
<m long="11">Un sacré caractère. </m>
<n/>
<m long="3">Un sacré raccourci. </m>
</l>
<l name="4">
<m long="6">Un endroit qui n'était pas dans le vent.</m>
<n/>
<m long="2">Poétiquement vert et bleu.</m>
<n/>
<m long="5">Poétiquement tout blanc. </m>
<n/>
<m long="2">Possessif.</m>
<n/>
<m long="1"/>
</l>

</racine>









--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--







--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>