bom dia…
estou aprendendo o jdom…
e queria saber como faço varios parens em um root…
tipo assim:
<pai>
<filho>1<filho/>
<filho>2<filho/>
<filho>3<filho/>
<filho>4<filho/>
</pai>
Element pai= new Element("pai");
Element filho= new Element("filho");
for (int i=0;i<4;i++){
pai= new Element("pai");
filho.setText(""+i);
pai.addContent(filho);
}
mas to conceguindo nao… da dando o seguinte erro:
[color=darkred]Exception in thread “main” org.jdom.IllegalAddException: The Content already has an existing parent “pai”[/color]
obrigado a todos
