Skip to main content
March 23, 2017
Question

Using dot(.) in custom tag variable

  • March 23, 2017
  • 1 reply
  • 495 views

Hi,

I want to implement a custom tag for <cfset. I am able to implement but facing issue that i cannot use dot(.) operator in variable name

For e.g.

<cf_set url.value="123"> is not allowed and it gives following error:

coldfusion.compiler.TokenMgrError: Invalid token . found on line 8 at column 27. 
at coldfusion.compiler.cfml40TokenManager.getNextToken(cfml40TokenManager.java:6658)
at coldfusion.compiler.cfml40.jj_ntk(cfml40.java:13711)
at coldfusion.compiler.cfml40.TagAttribute(cfml40.java:5488)
at coldfusion.compiler.cfml40.attribute_list_aux(cfml40.java:5356)
at coldfusion.compiler.cfml40.attribute_list(cfml40.java:5334)
at coldfusion.compiler.cfml40.cftag(cfml40.java:224)

but "." operator is allowed with <cfset url.value and it works fine.

Please provide thoughts to resolve it for use of "." with custom tag variable name

This topic has been closed for replies.

1 reply

WolfShade
Legend
March 23, 2017

Can't say, for sure, without seeing the code for your custom tag "set".

Variables cannot be named using punctuation (except maybe underscore), which your tag thinks "url.value" is the name of the variable, not a variable within the URL scope.

HTH,

^_^

Inspiring
March 23, 2017

If you are trying to rewrite the url scope with a custom tag, this wont be possible.

What you want to do is pass the scope into the custom tag and return the sanitise version.

<cf_set value="#url.value#" returnvar="someValue" >

<cfdump var="#someValue#">

Something like this - coldfusion custom tag return variable - Stack Overflow