def visit_attribute_condition node
attribute = if (node.value.first.type == :FUNCTION) or (node.value.first.value.first =~ /::/)
''
else
'@'
end
attribute += node.value.first.accept(self)
attribute.gsub!(/^@@/, '@')
return attribute unless node.value.length == 3
value = node.value.last
value = "'#{value}'" if value !~ /^['"]/
case node.value[1]
when '*='
"contains(#{attribute}, #{value})"
when '^='
"starts-with(#{attribute}, #{value})"
when '|='
"#{attribute} = #{value} or starts-with(#{attribute}, concat(#{value}, '-'))"
when '~='
"contains(concat(\" \", #{attribute}, \" \"),concat(\" \", #{value}, \" \"))"
when '$='
"substring(#{attribute}, string-length(#{attribute}) - " +
"string-length(#{value}) + 1, string-length(#{value})) = #{value}"
else
attribute + " #{node.value[1]} " + "#{value}"
end
end