[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Contents of a
into an AVT?


Subject: RE: [xsl] Contents of a <div> into an AVT?
From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx>
Date: Wed, 6 Aug 2003 15:52:57 -0400

Thank you. That was it exactly...when I was receiving an error message about
the variable missing, didn't get that it was out of scope...but I'm glad to
know it wasn't the use of the variable...because then I would be back to
square one...I had though I'd made a little progress.

:-)

Kat

-----Original Message-----
From: Martinez, Brian [mailto:brian.martinez@xxxxxxxxxxx]
Sent: Wednesday, August 06, 2003 2:42 PM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: RE: [xsl] Contents of a <div> into an AVT?


> From: Kathy Burke [mailto:Kathy_Burke@xxxxxxxxx]
> Sent: Wednesday, August 06, 2003 12:19 PM
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject: RE: [xsl] Contents of a <div> into an AVT?
> 
> 
> that just gives me 'this.id'. If I put a number in the 
> script, it works
> fine. I need it to be dynamic based on the <step> element's 
> xsl:number.
> Using the <xsl:variable> and <div> as I indicated, gives me 
> the correct html
> EXCEPT when referring to the {id} within the script. Perhaps 
> I took the
> wrong approach all together?
> 
> Hope I'm not being dense, again.

Since you're creating the value of the id attribute via XSLT, and it's in a
consistent format, couldn't you also create the argument passed into your
JavaScript function the same way?  Something like:

<xsl:variable name="id">
  <xsl:number level="multiple" count="step" format="1.1"/>
</xsl:variable>

<input type="button" value="Anomaly"
  onclick="Javascript:Anomaly('Step_{$id}','{.}')"></input>

<div id="Step_{$id}">
  <xsl:value-of select="$id"/>
</div>

(Note I moved your xsl:variable declaration above the input element--it may
just be a matter of rearranging your template.)

hth,
b.

| brian martinez                           brian.martinez@xxxxxxxxxxx |
| lead gui programmer                                    303.357.3548 |
| cheap tickets, part of trip network                fax 303.357.3380 |
| 6560 greenwood plaza blvd., suite 400           englewood, co 80111 |
| cendant travel distribution services   http://www.cheaptickets.com/ |

 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
Keywords