Solved

Trying to access Node with variable in Xml

Posted on 2004-10-07
3
194 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now