How i can write this :
<context:annotation-config/>
<context:component-scan base-package="com.generator"/>
using jdom2. i tried by :
beans.addContent(new Element("context:annotation-config")); beans.addContent(new Element("context:component-scan").setAttribute("base-package","com."+getProjectName()))
but i had this error:
The name "context:annotation-config" is not legal for JDOM/XML elements: XML name 'context:annotation-config' cannot contain the character ":".
Create a Namespace as
Then create your
Element
using new Element (String, Namespace)