[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: RE: [xsl] Contents of a
RE: RE: [xsl] Contents of a into an AVT?
Subject: RE: RE: [xsl] Contents of a <div> into an AVT?
From: cknell@xxxxxxxxxx
Date: Wed, 06 Aug 2003 14:43:27 -0400
There is a lot of confusing stuff going on here.
1) If you want to get the value of an <xsl:variable>, you must preface the variable name with a "$". Thus the value of <xsl:variable name="id"> can be accessed as "$id". Your AVTs should therefor read {$id}, not {id}.
2) You have defined your variable lower in the stylesheet than your first reference to it. I don't know if XSLT processors resolve the values of variables in a given context before they begin processing (I suspect this is true), but it would be much easier to understand you template if you put the variable definitions at the earliest possible position in the context.
--
Charles Knell
cknell@xxxxxxxxxx - email
-----Original Message-----
From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx>
Sent: Wed, 6 Aug 2003 14:13:57 -0400
To: "'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: [xsl] Contents of a <div> into an AVT?
Sorry, I didn't provide that info. For this xml element:
<step>This is the first step.</step>
My template does the following:
(1) Creates an html table structure.
(2) In the first column, creates a button with an onclick event (which
requires use of variables to pass querystring).
(3) Second column, apply xsl:number to the <step> which gives me:
1. This is the first step.
That onclick event for each <step>'s button needs the two variables ('the
number', 'the text of the step'). I capture the 2nd var using {.}. but can't
figure out how to get the "number" (1.2, 1.3, etc.).
***********************
If I may, here is the template for the step...the entire xsl is rather long.
<xsl:template match="step">
<table>
<tr>
<td align="center" valign="middle">
<input type="button" value="Anomaly"
onclick="Javascript:Anomaly('{id}','{.}')"></input>
</td>
<td>
<xsl:variable name="id">
<xsl:number level="multiple" count="step" format="1.1"/>
</xsl:variable>
<div id="Step_{$id}">
<xsl:value-of select="$id"/>
</div>
<xsl:apply-templates select="step"/>
</td>
</tr>
</table>
</xsl:template>
*****************
So, need to get the '1.2' (for example) into that first '___' variable in
the script depending on which step. (position doesn't work, of course, since
the numbering level=multiple)
Thanks for responding.
Kat
-----Original Message-----
From: cknell@xxxxxxxxxx [mailto:cknell@xxxxxxxxxx]
Sent: Wednesday, August 06, 2003 1:48 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Contents of a <div> into an AVT?
If I understand your question, I don't think that your answer lies in XSLT,
but rather in JavaScript and the HTML DOM. Of which element is the "onclick"
event handler you showed in your message a part?
If your HTML has this element:
<div id="Step_2.1" onclick="Javascript:newWin('here is where i need the
above', '{para}')">2.1 </div>
Then try this:
<div id="Step_2.1 " onclick="Javascript:newWin('here is where i need the
above', event.srcElement.getAttribute('id'))">2.1 </div>
Of course, if I don't understand your question, that answer will be wrong.
--
Charles Knell
cknell@xxxxxxxxxx - email
-----Original Message-----
From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx>
Sent: Wed, 6 Aug 2003 12:06:38 -0400
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Contents of a <div> into an AVT?
Hello. I'm sure I'll phrase this incorrectly..but here goes.
building html table, my xsl contains:
<xsl:variable name="id">
<xsl:number level="multiple" count="step" format="1.1">
</xsl:variable>
<div id="Step_{$id}">
<xsl:value-of select="$id"/>
</div>
This results as desired:
<div id="Step_2.1 ">2.1 </div>
My question is: how to get either the div id ("Step_2.1") or div contents
("2.1") into a script parameter?
In my html, I have onclick="Javascript:newWin('here is where i need the
above', '{para}')"
The {para} give me the content of the <step> correctly.
I though {id} would work, but it remains blank.
Any clues?
Thanks.
Kat
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
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
- RE: [xsl] Contents of a <div> into an AVT?, (continued)
- Américo Albuquerque - Thu, 7 Aug 2003 01:13:01 +0100
- Kathy Burke - Wed, 6 Aug 2003 14:19:11 -0400
- David Carlisle - Thu, 7 Aug 2003 22:09:30 +0100
- Martinez, Brian - Wed, 6 Aug 2003 12:41:47 -0600
- cknell - Wed, 06 Aug 2003 14:43:27 -0400 <=
- Kathy Burke - Wed, 6 Aug 2003 15:52:57 -0400
<- Previous Index Next ->
RE: [xsl] Contents of a <div> into , Martinez, Brian
Thread
RE: [xsl] Contents of a <div> into , Kathy Burke
RE: [xsl] Contents of a <div> into , Martinez, Brian
Date
Re: [xsl] Re: decent validator, J.Pietschmann
Month
Subject: RE: RE: [xsl] Contents of a <div> into an AVT? From: cknell@xxxxxxxxxx Date: Wed, 06 Aug 2003 14:43:27 -0400 |
There is a lot of confusing stuff going on here. 1) If you want to get the value of an <xsl:variable>, you must preface the variable name with a "$". Thus the value of <xsl:variable name="id"> can be accessed as "$id". Your AVTs should therefor read {$id}, not {id}. 2) You have defined your variable lower in the stylesheet than your first reference to it. I don't know if XSLT processors resolve the values of variables in a given context before they begin processing (I suspect this is true), but it would be much easier to understand you template if you put the variable definitions at the earliest possible position in the context. -- Charles Knell cknell@xxxxxxxxxx - email -----Original Message----- From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx> Sent: Wed, 6 Aug 2003 14:13:57 -0400 To: "'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: RE: [xsl] Contents of a <div> into an AVT? Sorry, I didn't provide that info. For this xml element: <step>This is the first step.</step> My template does the following: (1) Creates an html table structure. (2) In the first column, creates a button with an onclick event (which requires use of variables to pass querystring). (3) Second column, apply xsl:number to the <step> which gives me: 1. This is the first step. That onclick event for each <step>'s button needs the two variables ('the number', 'the text of the step'). I capture the 2nd var using {.}. but can't figure out how to get the "number" (1.2, 1.3, etc.). *********************** If I may, here is the template for the step...the entire xsl is rather long. <xsl:template match="step"> <table> <tr> <td align="center" valign="middle"> <input type="button" value="Anomaly" onclick="Javascript:Anomaly('{id}','{.}')"></input> </td> <td> <xsl:variable name="id"> <xsl:number level="multiple" count="step" format="1.1"/> </xsl:variable> <div id="Step_{$id}"> <xsl:value-of select="$id"/> </div> <xsl:apply-templates select="step"/> </td> </tr> </table> </xsl:template> ***************** So, need to get the '1.2' (for example) into that first '___' variable in the script depending on which step. (position doesn't work, of course, since the numbering level=multiple) Thanks for responding. Kat -----Original Message----- From: cknell@xxxxxxxxxx [mailto:cknell@xxxxxxxxxx] Sent: Wednesday, August 06, 2003 1:48 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] Contents of a <div> into an AVT? If I understand your question, I don't think that your answer lies in XSLT, but rather in JavaScript and the HTML DOM. Of which element is the "onclick" event handler you showed in your message a part? If your HTML has this element: <div id="Step_2.1" onclick="Javascript:newWin('here is where i need the above', '{para}')">2.1 </div> Then try this: <div id="Step_2.1 " onclick="Javascript:newWin('here is where i need the above', event.srcElement.getAttribute('id'))">2.1 </div> Of course, if I don't understand your question, that answer will be wrong. -- Charles Knell cknell@xxxxxxxxxx - email -----Original Message----- From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx> Sent: Wed, 6 Aug 2003 12:06:38 -0400 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] Contents of a <div> into an AVT? Hello. I'm sure I'll phrase this incorrectly..but here goes. building html table, my xsl contains: <xsl:variable name="id"> <xsl:number level="multiple" count="step" format="1.1"> </xsl:variable> <div id="Step_{$id}"> <xsl:value-of select="$id"/> </div> This results as desired: <div id="Step_2.1 ">2.1 </div> My question is: how to get either the div id ("Step_2.1") or div contents ("2.1") into a script parameter? In my html, I have onclick="Javascript:newWin('here is where i need the above', '{para}')" The {para} give me the content of the <step> correctly. I though {id} would work, but it remains blank. Any clues? Thanks. Kat XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Contents of a <div> into , Martinez, Brian | Thread | RE: [xsl] Contents of a <div> into , Kathy Burke |
RE: [xsl] Contents of a <div> into , Martinez, Brian | Date | Re: [xsl] Re: decent validator, J.Pietschmann |
Month |
Products
Features
Resources
Support
Oxygen XML on Facebook
Follow
Oxygen XML on Twitter
Oxygen XML Web Feed
Oxygen XML
Blog
Oxygen XML Youtube Channel
© 2002-2022 SyncRO Soft SRL. All rights reserved.
This website was created & generated with <oXygen/>®XML Editor