User 35bef27df0
02-05-2006 18:00:47
DOm4J can not merge 2 documents
setContent works but clears ALL previous contend
element.appendContent(Branch) has No result ???
are ther other rules to respect
ex
<root><info a="original/></root>
append <info b="append" />
Element(Root/info) .asXML shows <info a="original/>
Element(Root/info).appendContent(branch(<info b='appen' />
just does not do anithing no errors no insert
static public void appenLIST(Branch nod,List branch,int counts)
{ int count=0;
if (!(Nod instanceof Element)) Nod=Nod.getParent();//force element
Element Parent=nod.getParent();
if (Parent!=null)Parent.remove(nod);//works
if (counts==0) //only for the first
while (count < br.size())
{ Branch lstitm=(Branch) branch.get(count);
// ((Element)nod).add(lstitm.detach()) ;//FAILS ONLY node NOT THE CONTENT IS COPIED
((Element) nod).appendContent(lstitm) ; //no result !!!????
System.out.print("\n"+((Element) Parent).getDocument().asXML());
count++;}
}
setContent works but clears ALL previous contend
element.appendContent(Branch) has No result ???
are ther other rules to respect
ex
<root><info a="original/></root>
append <info b="append" />
Element(Root/info) .asXML shows <info a="original/>
Element(Root/info).appendContent(branch(<info b='appen' />
just does not do anithing no errors no insert
static public void appenLIST(Branch nod,List branch,int counts)
{ int count=0;
if (!(Nod instanceof Element)) Nod=Nod.getParent();//force element
Element Parent=nod.getParent();
if (Parent!=null)Parent.remove(nod);//works
if (counts==0) //only for the first
while (count < br.size())
{ Branch lstitm=(Branch) branch.get(count);
// ((Element)nod).add(lstitm.detach()) ;//FAILS ONLY node NOT THE CONTENT IS COPIED
((Element) nod).appendContent(lstitm) ; //no result !!!????
System.out.print("\n"+((Element) Parent).getDocument().asXML());
count++;}
}