![]() |
Please help!! JavaScript XSL combine
Hi,
I have a JavaScript function which is embeded in an XSL file, I am using this to try and bring back a list of strings based on a number of rows in an XML file. The problem I have is that I do not have the url of the XML file as this is created on the fly so I cannot load this in to look at the specific nodes of the file. I am therefore trying to get some info from the XML file using an XSL tranformation in my javascript code. This works great, apart from one part of the code which I cannot get to use the variable "i". This is the part [@index=1] in the code below. Code:
function Test()I have tried things such as trying to split the text "<xsl:value-of select="Data/DataRow[@index=1]/ID" />" into "<xsl:value-of select="Data/DataRow[@index=" +(i+1)+ "]/ID" />" but this brings up an error saying "The XSL could not be parsed. The error is Name cannot begin with the '+' character, hexadecimal value 0x2B. Line 16, position 99." Any help would be greatly appreacted as I am pulling my hair out trying to get this to work. Many thanks, Laurence |
Your use of quotation is incorrect: you cannot nest double quotes within double quotes.
"This "won't" work" "This \"will\" work, using 'escaping'" "This 'will also' work, using apostrophes" |
Quote:
Code:
"<xsl:value-of select=\"Data/DataRow[@index="+(i+1)+"]/ID\" />&attendanceTypeID="Code:
"<xsl:value-of select='Data/DataRow[@index="+(i+1)+"]/ID' />&attendanceTypeID=" |
I'm guessing this
Code:
inputList.item(i)[inputList.item(i).selectedIndex].valueCode:
inputList[inputList.selectedIndex].value |
| All times are GMT +1. The time now is 10:07 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.