Using "is less than" character (<) in a XML document and parse it

1k Views Asked by At

I need to parse a XML document in which there are conditions like the below example:

<element condition="var < 5">element name</element>

The problem is that the parser doesn't allow this 'is less than' (<) character.

I tried GDataXML -> it gives me an error saying there is an illegal character.

I also tried TBXML -> it doesn't take into account the attributes where there is this character.

I guess it's the same for other parsers.

How can I fix this?

1

There are 1 best solutions below

5
On BEST ANSWER

You should replace < with &lt;