1

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

0 回答 0