我正在使用jdom2,当尝试使用空格设置元素值时会弹出错误。
部分代码如下:
Element feature = new Element("feature");
feature.setAttribute("name", "semantic role");
错误:
Exception in thread "main" org.jdom2.IllegalNameException: The name "semantic role" is not legal for JDOM/XML attributes: XML names cannot contain the character " ".