Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xml javascript lunghezza campo tabella

From: "Joris Gillis" <roac@-------.-->
To: 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent