XML中,属性值内的特殊字符需要转义:
- '<' 应转义为 <
- '>' 应转义为 >
- '&' 应转义为 &
因此下面的>=, <=应该转义:
data3.AppendLine(@"<Formula AssignTo=""挡料气缸动点"" Comment="""" Formula=""if Parameter_1>=p167-1 then true else false""/>");
data3.AppendLine(@"<Formula AssignTo=""挡料气缸原点"" Comment="""" Formula=""if Parameter_1<=p168+1 then true else false""/>");