用Java编写XML文本数据的最佳方法? [英] Best way to encode text data for XML in Java?
本文介绍了用Java编写XML文本数据的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
与这个问题非常相似,除了Java 。
Very similar to this question, except for Java.
在Java中为XML输出编码字符串的推荐方法是什么?字符串可能包含&,&等字符。
What is the recommended way of encoding strings for an XML output in Java. The strings might contain characters like "&", "<", etc.
推荐答案
很简单:使用XML库。这样它实际上将是 ,而不需要详细了解XML规范的位。
Very simply: use an XML library. That way it will actually be right instead of requiring detailed knowledge of bits of the XML spec.
这篇关于用Java编写XML文本数据的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文