2

I am using cfscript to delete xml nodes, however, I am having issues deleting the names dynamically. hard coded pseudo example:

<cfscript>  
ArrayClear(xmlNav.myXmlDoc.UL[1].LI[2]);
</cfscript>

how can I set value to be deleting dynamically i.e.

<cfscript>  
ArrayClear("xmlNav.myXmlDoc#xmlNav.xmlPath#");
</cfscript>

xmlNav.xmlPath = ".UL[1].LI[2]"

thank you for you help

Chris Hough
  • 3,389
  • 3
  • 41
  • 80

1 Answers1

0

Try using Evaluate():

<cfscript>  
    ArrayClear(Evaluate("xmlNav.myXmlDoc" & #xmlNav.xmlPath#));
</cfscript>
James Hill
  • 60,353
  • 20
  • 145
  • 161
  • it did work with evaluate but is there a way to do it without using evaluate as that can be pretty slow at times. if not I will stick with it? – Chris Hough Mar 23 '12 at 22:53