You may have seen this one before but I just saw it for the first time. Probably because I typically don't use CFFUNCTION in this method.

I had the following code:

view plain print about
1<attrib name="#param#" type="#attrType(vals)#">

and the function:

view plain print about
2    <CFARGUMENT NAME="vals">    
3    <CFIF len(vals)>
4        <CFRETURN "Enumerated"/>
5    <CFELSE>
6        <CFRETURN "TEXT"/>
7    </CFIF>

The problem was my output was...

view plain print about
1<attrib name="keys" type=" TEXT" />

Notice the extra space before "text". It was breaking what I was trying to do. So, I changed the function to this and the space was gone.

view plain print about
2    function attrType(vals){
3        if lenn(vals)){
4            return 'Enumerated';    
5        } else {
6            return 'Text';
7        }
8    }

So this got me curious and I started digging. I figured out that if I add the OUTPUT="NO" param to the CFFUNCTION tag the space goes away.

Just something to look out for.

Till next time.