How to tell if a string is xml?

后端 未结 7 1593
北荒
北荒 2021-01-11 10:44

We have a string field which can contain XML or plain text. The XML contains no header, and no root element, i.e. is not well formed.

We need t

相关标签:
7条回答
  • 2021-01-11 11:26

    If you're going to accept not well formed XML in the first place, I think catching the exception is the best way to handle it.

    0 讨论(0)
提交回复
热议问题