jfill89
asked on
Trying to access Node with variable in Xml
I am trying to put a variable into some code that is being used to access a node in an Xml Doc. Below is what I am trying but I keep getting an error. I am not sure how to make it work.
<cfset bestPrice[2] = "#XmlRateSheet.investor.pr oducts.#Pr oductCode# .rates.rat esdata[4]. exp2.XmlTe xt#">
As you can see above #ProductCode# is the variable that needs to be introduced in this code as a variable. Any thoughts on how I can work around this? The error is below.
Thanks,
jfill
A CFML variable name cannot end with a "." character.
The variable XmlRateSheet.investor.prod ucts. ends with a "." character. You must supply an additional structure key or delete the "." character.
The CFML compiler was processing
<cfset bestPrice[2] = "#XmlRateSheet.investor.pr
As you can see above #ProductCode# is the variable that needs to be introduced in this code as a variable. Any thoughts on how I can work around this? The error is below.
Thanks,
jfill
A CFML variable name cannot end with a "." character.
The variable XmlRateSheet.investor.prod
The CFML compiler was processing
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok I got it figured out.
<cfset bestPrice[2] = Evaluate("XmlRateSheet.inv estor.prod ucts." & "#ProductCode#" & ".rates.ratesdata[4].exp2. XmlText")>
That seems to do the trick.
jfill
<cfset bestPrice[2] = Evaluate("XmlRateSheet.inv
That seems to do the trick.
jfill
ASKER
I am getting the same error when I try
<cfset bestPrice[2] = Evaluate("XmlRateSheet.inv
jfill