0
votes

How can I turn on syntax highlighting in Netbeans for sql statements inside an xml file?
I'm using MyBatis, one of my mapper.xml looks something like this:

<mapper namespace="org.example.ChartDataMapper">
 <cache/>
 <select id="getData" resultType="ChartData" >
  <![CDATA[
   SELECT * FROM data;
  ]]>
 </select>
</mapper>

The actual select is a bit more complicated, but that's beside the point. I'd like to see syntax highlighted sql inside the CDATA, but right now everything is colored brown.

1

1 Answers

0
votes

Netbeans treats content within xml tags as srings/text.

You can see (v7.4 -> Tools -> Options -> Fonts & Colors -> Language: XML -> CDATA Section) that there's only a possiblity to set whole text foreground color (font, bg color, lines color as well).

In my opinion there's nothing you can do about it.