Solved

Trying to access Node with variable in Xml

Posted on 2004-10-07
3
202 Views
Last Modified: 2013-12-24
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.products.#ProductCode#.rates.ratesdata[4].exp2.XmlText#">

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.products. ends with a "." character. You must supply an additional structure key or delete the "." character.
The CFML compiler was processing
0
Comment
Question by:jfill89
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
hart earned 125 total points
ID: 12249588
try evaluate
<cfset bestPrice[2] = Evaluate("XmlRateSheet.investor.products.#ProductCode#.rates.ratesdata[4].exp2.XmlText")>

Regards
Hart
0
 
LVL 1

Author Comment

by:jfill89
ID: 12249645
Hart,

I am getting the same error when I try
<cfset bestPrice[2] = Evaluate("XmlRateSheet.investor.products.#ProductCode#.rates.ratesdata[4].exp2.XmlText")>

jfill
0
 
LVL 1

Author Comment

by:jfill89
ID: 12249715
Ok I got it figured out.

<cfset bestPrice[2] = Evaluate("XmlRateSheet.investor.products." & "#ProductCode#" & ".rates.ratesdata[4].exp2.XmlText")>

That seems to do the trick.

jfill
0

Featured Post

Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question