Andrew
Andrew

Reputation: 2539

angle bracket in xml value

How can I put an angle bracket ("<") in my xml attribute?

I'm trying to store an SQL query, but this seems to be illegal.

<add key="query" value="SELECT DISTINCT index FROM table WHERE langCode <> 'FR'"/>

Upvotes: 41

Views: 25623

Answers (1)

Adam Batkin
Adam Batkin

Reputation: 53024

Use &lt; and &gt; instead of < and >:

<add key="query" value="SELECT DISTINCT index FROM table WHERE langCode &lt;&gt; 'FR'"/>

Upvotes: 67

Related Questions