org.jdom2.IllegalNameException

时间:2013-10-10 16:06:02

标签: java xml jdom

我正在使用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 " ".

0 个答案:

没有答案