xml javascript lunghezza campo tabella

Discussion in 'XML' started by melogranina@yahoo.it, Dec 1, 2004.

  1. Guest

    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:eek:range;}</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
     
    , Dec 1, 2004
    #1
    1. Advertising

  2. Joris Gillis Guest

    > 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:eek:range;}</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
     
    Joris Gillis, Dec 1, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest

    forse OT: visualizzazione tabella

    Guest, May 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    409
    Guest
    May 17, 2004
  2. Eswa

    tabella e link

    Eswa, Aug 30, 2005, in forum: HTML
    Replies:
    22
    Views:
    1,122
    Ed Jay
    Sep 1, 2005
  3. SAN CAZIANO
    Replies:
    0
    Views:
    131
    SAN CAZIANO
    Oct 19, 2004
  4. Erik Wasser
    Replies:
    5
    Views:
    468
    Peter J. Holzer
    Mar 5, 2006
  5. noff
    Replies:
    0
    Views:
    212
Loading...

Share This Page