[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Computed HTML Attribute Value

Subject: Re: Computed HTML Attribute Value
From: RSuiter@xxxxxxxxx
Date: Wed, 31 Jan 2001 17:38:08 -0600
computed value javascript
Tom,

Why bother with JavaScript here?

I took your xsl fragment, removed the script tag and modified the line that
does the calculation as follows:

    <xsl:element name="input">
     <xsl:attribute name="type">text</xsl:attribute>
     <xsl:attribute name="name">new_delay_hr</xsl:attribute>
     <xsl:attribute name="value">
<!--  <script language="JavaScript">   -->
       <xsl:value-of select="delayed-start-time/text() div 3600"/>
<!--  </script>                        -->
     </xsl:attribute>
     <xsl:attribute name="size">2</xsl:attribute>
    </xsl:element>

This should give you about what you want.

Rick suiter




"Tom Gilbert" <tom.gilbert@xxxxxxxxxxxxx>@lists.mulberrytech.com on
01/30/2001 06:18:06 PM

Please respond to xsl-list@xxxxxxxxxxxxxxxxxxxxxx

Sent by:  owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx


To:   <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
cc:
Subject:   Computed HTML Attribute Value


Having trouble with testXSLT using JavaScript to compute the value of an
HTML attribute, it crashes trying to do this transform. I would like to
know if I am doing something illegal or is it a problem with testXSLT.
Is there another way to get a computed value assigned to an HTML attribute?

Here "delayed-start-time/text()" is in seconds and I need it displayed in
hours.


    <xsl:element name="input">
     <xsl:attribute name="type">text</xsl:attribute>
     <xsl:attribute name="name">new_delay_hr</xsl:attribute>
     <xsl:attribute name="value">
      <script language="JavaScript">
       <xsl:value-of select="delayed-start-time/text()"/>/3600;
      </script>
     </xsl:attribute>
     <xsl:attribute name="size">2</xsl:attribute>
    </xsl:element>hr

HTML I am looking for (assuming 18000 seconds):

<input type="text" name="new_delay_hr" value="5" size="2"/>hr

Tom Gilbert
tom@xxxxxxxxxxxxx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.