Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - xml javascript lunghezza campo tabella [Thread Next] Re: xml javascript lunghezza campo tabellaTo: NULL Date: 12/1/2004 4:22:00 PM > Salve!
> Ho la necessità di creare un documento xsl con una tabella che deve
> avere i campi della stessa lunghezza del valore ottenuto da una
> funzione javascript:
>
>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
> <xsl:template match="/">
> <style>.fr {background-color:orange;}</style>
> <style>.cella {font-family:Arial,sans-serif;
> font-size:10pt;font-weight:100;text-align:left;text-transform:capitalize;color:white;}</style>
> <style>.xy {background-color:#99FF66;}</style>
> <style>.pr {background-color:yellow;}</style>
> <style>.m {background-color:red;}</style>
> <style>.mr {background-color:#FFFFCC;}</style>
> <xsl:for-each select="rows/row">
> <table border="0">
> <TR>
> <TD class="fr">
> <xsl:attribute name="width">
> <xsl:value-of select="gradi"/>
> </xsl:attribute>
> </TD>
>
> Come faccio ad inserire la funzione JS per impostare il width del td??
> Grazie
>
Hi,
Not that I know any Italian, but I think I understood your question.
I could be totally wrong, but here I go:
In the deprecated XSLT 1.1 working draft, there were plans to implement an element 'script' to allow extension function via scripts. It would look like this:
<xsl:script implements-prefix="my-exstensions" language="javascript">
function calcWidth() {
}
</xsl:script>
That script would then be called with this:
<xsl:value-of select="my-exstensions:calcWidth()"/>
You might be using a transformation engine like Xalan that supports this non-existing XSLT 1.1
But I think XSLT 2.0 will allow it somehow eventually.
But as a general remark, I don't see why you should manually calculate the width of any table, as browsers can do that themselves.
regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
Ceterum censeo XML omnibus esse utendum
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
