Since <
& >
as part of XML syntax. How to add these symbols as part of the data like
<Note>Have to have <> symbols</Note>
I have heard there are different types of data in which XML can be sent like CDATA etc, since character data parses each character it doesn't allow these symbols.
I do know about <
and >
but that isn't helpful.
Are there are any modes of data in which XML can be sent to avoid any tool recognizing the symbols?
<
is encoded as <
.>
is encoded as >
."
is encoded as "
.&
is encoded as &
.
Alternatively, you can pack the whole data in a CDATA section if it doesn't contain a CDATA section itself. If you're generating programatically, encoding each character is the better solution though.
Note that there is a plethora of XML libraries available for almost every language. Unless you want to learn about XML, I strongly recommend using an XML library instead of writing your own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With