# File lib/xtemplate/node.rb, line 398 def expand_attr(data) # substituting attribute values. @attrs = ([[nil,@exname],[nil,@exattr]]+@attrs).collect{|attr,val| [ attr, if( val ) val.gsub(/(@@?)[\{\(](.+?)[\}\)]/){|str| at = $1 key = $2 case at.size when 1 if( data.is_a?(Hash) ) v = data[key] case v when Hash str = v[TextNode] || '' else str = v.to_s end else str = '' end when 2 str[0,1] = '' end sanitize(str) } else nil end ] } @exname = @attrs.shift()[1] @exattr = @attrs.shift()[1] if( @exname ) @name = @exname @exname = nil end end