What are invalid characters in XML

后端 未结 15 1250
时光说笑
时光说笑 2020-11-22 03:23

I am working with some XML that holds strings like:

This is a string

Some of the strings that I am passing to the

15条回答
  •  伪装坚强ぢ
    2020-11-22 04:01

    In addition to potame's answer, if you do want to escape using a CDATA block.

    If you put your text in a CDATA block then you don't need to use escaping. In that case you can use all characters in the following range:

    Note: On top of that, you're not allowed to use the ]]> character sequence. Because it would match the end of the CDATA block.

    If there are still invalid characters (e.g. control characters), then probably it's better to use some kind of encoding (e.g. base64).

提交回复
热议问题