Filtering illegal XML characters in Java

后端 未结 7 1592
粉色の甜心
粉色の甜心 2020-12-30 09:19

XML spec defines a subset of Unicode characters which are allowed in XML documents: http://www.w3.org/TR/REC-xml/#charsets.

How do I filter out these characters from

相关标签:
7条回答
  • 2020-12-30 09:47

    It's not trivial to find out all the invalid chars for XML. You need to call or reimplement the XMLChar.isInvalid() from Xerces,

    http://kickjava.com/src/org/apache/xerces/util/XMLChar.java.htm

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