zl程序教程

您现在的位置是:首页 >  后端

当前栏目

C#-How to use less than sign and greater than sign symbols in xml query?

c#XML to in and How use Query
2023-09-11 14:21:57 时间

How to use less than < and greater than > symbols in xml query?

 

How to use less than < and greater than > symbols in XML instead of &lt and &gt

<Query>select * from tbl_reservation where fair > 1000 and fair < 50000</Query>

Why do you care? Are you trying to make it easier to produce, consume, or read?
Any XML tools used to generate will escape it for you (you aren't just concatenating strings to generate XML are you?).
 – Mads HansenApr 8 '17 at 12:35

You could use a CDATA section, which allows for characters to be included without being escaped:

<Query><![CDATA[select * from tbl_reservation where fair > 1000 and fair < 50000]]></Query>

However, if you are using XML tools to construct your XML, they will handle the character escaping of text() values.