When we need to pass xml format processing sql statements are often used < ,<=,>,>=xml format error, which causes the background to xml string converted to xml document times wrong, resulting in a program error.
Such problems often need us to deal with in IBatiS or in a custom XML-processing SQL program. In fact, it is very simple, we just need to replace the following to avoid the above error:
Original symbol |
< |
<= |
> |
>= |
& |
‘ |
" |
Replace symbol |
< |
<= |
> |
>= |
& |
' |
" |
Bad XML format:
<?XML version= "1.0" encoding= "GBK"?> <Queryformtoken= "32sdfj-349sfdnfs32-fsdf348imfg323-df34"TableName= "Hsy_t_customer"pageSize= " the"PageNo= "1"Ordercolumn=""OrderType=""> <sqlcondition>and start_date >= to_date (' 2013-01-01 ', ' yyyy-mm-dd ') and start_date<= To_date(' 2013-01-30 ', ' yyyy-mm-dd ') </sqlcondition> </Queryform>
Error in Altova XMLSpy tool, XML does not conform to format requirements.
The correct XML format:
<?XML version= "1.0" encoding= "GBK"?> <Queryformtoken= "32sdfj-349sfdnfs32-fsdf348imfg323-df34"TableName= "Hsy_t_customer"pageSize= " the"PageNo= "1"Ordercolumn=""OrderType=""> <sqlcondition>and start_date>= To_date (' 2013-01-01 ', ' yyyy-mm-dd ') and start_date<= To_date (' 2013-01-30 ', ' yyyy-mm-dd ')</sqlcondition> </Queryform>
Validation passed in the Altova XMLSpy tool.
Original link: http://blog.csdn.net/hu_shengyang/article/details/8513655
"Go" processing a SQL statement through XML with less than sign and greater than