Use of Greater Than Symbol in XML
I had created the xml document with xml version="1.0".
In that document I need to use the greater than symbol >
and less than symbol <
.
How should I include those symbols? It's not working.
>
and <
are not working for me.
Is there any special encoder for this?
Solution 1:
You need the Character Entity References
< = <
> = >
Solution 2:
You can try to use CDATA to put all your symbols that don't work.
An example of something that will work in XML:
<![CDATA[
function matchwo(a,b) {
if (a < b && a < 0) {
return 1;
} else {
return 0;
}
}
]]>
And of course you can use <
and >
.
Solution 3:
Use >
and <
for 'greater-than' and 'less-than' respectively