Click here to Skip to main content
15,926,507 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: selected value in select box using xsl,xml Pin
28-Jun-02 4:59
suss28-Jun-02 4:59 
GeneralRe: selected value in select box using xsl,xml Pin
9-Jul-02 16:59
suss9-Jul-02 16:59 
GeneralSQLXML Schemas Pin
5-Jun-02 0:27
suss5-Jun-02 0:27 
GeneralRe: SQLXML Schemas Pin
jkgh20-Jun-02 7:32
jkgh20-Jun-02 7:32 
GeneralXMLNS issues with XSL transformation. Pin
Domenic Denicola2-Jun-02 16:43
Domenic Denicola2-Jun-02 16:43 
GeneralRe: XMLNS issues with XSL transformation. Pin
Wictor Wilén18-Jun-02 1:26
Wictor Wilén18-Jun-02 1:26 
GeneralRe: XMLNS issues with XSL transformation. Pin
Domenic Denicola18-Jun-02 10:21
Domenic Denicola18-Jun-02 10:21 
GeneralEmbed JavaScript into XSL Pin
Julz31-May-02 4:20
Julz31-May-02 4:20 
Okay - I am fairly new to XSL and am trying to embed some JavaScript into an existing XSL stylesheet. The JS is to prevent the refresh from blinking. This is a really long post - just a warning!!

This is a sample of the XSL where I need to embed the script:

<xsl:template name="coursestats">
<xsl:param name="Round"/>
<xsl:variable name="CourseAcronym" select="@CourseAcronym"/>
<table border="0" cellpadding="0" cellspacing="0" background="/images/mybg.gif" width="642">
<tr>
<td width="1" bgcolor="Olive"> </td>
<td width="34" height="14" class="titClass">Hole</td>
<td width="1" bgcolor="Olive"> </td>
<td width="30" height="14" class="titClass">Par</td>
<td width="1" bgcolor="Olive"> </td>
<td width="54" height="14" class="titClass">Yardage</td>
<td width="1" bgcolor="Olive"> </td>
<td width="74" height="14" class="titClass">Scoring Avg</td>
<td width="1" bgcolor="Olive"> </td>
<td width="34" height="14" class="titClass">Rank</td>
<td width="1" bgcolor="Olive"> </td>
<td width="106" height="14" class="titClass">Avg Over/Under Par</td>
<td width="1" bgcolor="Olive"> </td>
<td width="40" height="14" class="titClass">Eagles</td>
<td width="1" bgcolor="Olive"> </td>
<td width="42" height="14" class="titClass">Birdies</td>
<td width="1" bgcolor="Olive"> </td>
<td width="38" height="14" class="titClass">Pars</td>
<td width="1" bgcolor="Olive"> </td>
<td width="54" height="14" class="titClass">Bogeys</td>
<td width="1" bgcolor="Olive"> </td>
<td width="82" height="14" class="titClass">Double Bogeys</td>
<td width="1" bgcolor="Olive"> </td>
<td width="54" height="14" class="titClass">Other</td>
<td width="1" bgcolor="Olive"> </td>
</tr>
<xsl:for-each select="Hole">
<xsl:sort select="@HoleNumber" order="ascending" data-type="number"/>
<tr> <td width="1" bgcolor="Olive"> </td>
<td width="34" height="14" class="txtClass"><xsl:value-of select="@HoleNumber"/></td> <td width="1" bgcolor="Olive"> </td>
<td width="30" height="14" class="txtClass"><xsl:value-of select="@Par"/></td> <td width="1" bgcolor="Olive"> </td>
<td width="54" height="14" class="txtClass"><xsl:value-of select="@PublishedYardage"/></td> <td width="1" bgcolor="Olive"> </td>
<xsl:variable name="numerand" select="Round[@Number = $Round]/ScoreN"/>
<xsl:variable name="operand" select="Round[@Number = $Round]/ScoreO"/>
<td width="74" height="14" class="txtClass">
<xsl:if test="$numerand != 0"><xsl:value-of select="format-number($operand div $numerand, '0.000')"/></xsl:if>
</td> <td width="1" bgcolor="Olive"> </td>

This is the start of the JS that I am using - it works in my HTML but when I try to embed into the XSL I only get the opening and closing JS tags for output:

<html><head>
<script language="JavaScript"> <!--
function makeChange() {

var newData = '';

// START DATA
newData += '<table border=0 cellpadding=0 cellspacing=0 background="/images/mybg.gif" width="642">';
newData += '<tr>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
newData += ' <td width="34" height="14" class=titClass>Hole</td>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
newData += ' <td width="30" height="14" class=titClass>Par</td>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
newData += ' <td width="54" height="14" class=titClass>Yardage</td>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
newData += ' <td width="74" height="14" class=titClass>Scoring Avg</td>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
newData += ' <td width="34" height="14" class=titClass>Rank</td>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
newData += ' <td width="106" height="14" class=titClass>Avg Over/Under Par</td>';
newData += ' <td width="1" bgcolor="Olive"> </td>';

I don't know if my problem is the newData+=' '.

Can anyone shed some light?
THANKS!

Julia Confused | :confused:
GeneralRe: Embed JavaScript into XSL Pin
Erik Westermann31-May-02 8:54
professionalErik Westermann31-May-02 8:54 
GeneralRe: Embed JavaScript into XSL Pin
Julz3-Jun-02 3:21
Julz3-Jun-02 3:21 
GeneralHandling same element with different types. Pin
nay24-May-02 9:02
nay24-May-02 9:02 
GeneralRe: Handling same element with different types. Pin
Michael A. Barnhart24-May-02 10:34
Michael A. Barnhart24-May-02 10:34 
GeneralTwo questions Pin
Richard Deeming20-May-02 1:57
mveRichard Deeming20-May-02 1:57 
GeneralRe: Two questions Pin
Erik Westermann21-May-02 17:19
professionalErik Westermann21-May-02 17:19 
GeneralRe: Two questions Pin
Richard Deeming21-May-02 22:32
mveRichard Deeming21-May-02 22:32 
GeneralCompare XML files Pin
16-May-02 19:51
suss16-May-02 19:51 
GeneralRe: Compare XML files Pin
Mike.NET17-May-02 13:45
Mike.NET17-May-02 13:45 
GeneralRe: Compare XML files Pin
Sebastian Weber6-Jun-02 6:18
Sebastian Weber6-Jun-02 6:18 
Generaldynamic display of image from XML source Pin
16-May-02 4:23
suss16-May-02 4:23 
GeneralRe: dynamic display of image from XML source Pin
Christopher Lord23-Jun-02 8:08
Christopher Lord23-Jun-02 8:08 
GeneralRe: dynamic display of image from XML source Pin
jkgh24-Jun-02 0:46
jkgh24-Jun-02 0:46 
GeneralSpace in XML Pin
Hitu14-May-02 18:33
Hitu14-May-02 18:33 
GeneralRe: Space in XML Pin
MS le Roux14-May-02 20:19
MS le Roux14-May-02 20:19 
GeneralRe: Space in XML Pin
Not Active15-May-02 6:13
mentorNot Active15-May-02 6:13 
GeneralRe: Space in XML Pin
Michael A. Barnhart15-May-02 14:06
Michael A. Barnhart15-May-02 14:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.