I have written a C# application that loads XML files, parses them and uses the information to run SQL queries and send the results to email distribution lists.
These XML files are usually created by END users.
Currently I have them replacing > and < with > and < in the SQL, of course being END users they sometime forget. In fact they ALWAYS forget. I’d prefer to keep the query in an XML file. So, is there ANY way to force/allow the use of these special characters in XML files?
Right now my user must type this:
<?xml version="1.0" encoding="utf-8" ?>
<report>
<queries>
<query>
SELECT * FROM THETABLE WHERE THEVALUE > 100
</query>
</queries>
</report>
I’d like them to be able to type this:
<?xml version="1.0" encoding="utf-8" ?>
<report>
<queries>
<query>
SELECT * FROM THETABLE WHERE THEVALUE > 100
</query>
</queries>
</report>
You can wrap your queries in
CDATA: