hi, i am stuck at this and hope to seek some suggestions.
i have a document with the following structure
<returndoc>
<doc>
...
</doc>
</returndoc>
and i got a Vector of Nodes. each node has the following structure
<section>
<caption>section name</caption>
...
</section>
my idea is to go through the whole vector and for each Node in the vector, append to the document. my code is
Element docelement = (Element) sendingdoc.getDocumentElement().getLastChild();
int sv=sectionnodesv.size();
for(int i=0;i<sv;i++)
{
Node sectionnode = (Node) sectionnodesv.elementAt(i);
docelement.appendChild(sectionnode);
}
but then i get the following error:
org.apache.crimson.tree.DomEx: WRONG_DOCUMENT_ERR: That node doesn't belong in this document.
and i'd traced it to the appendChild line.
pls advise what could have went wrong, or if there is any method to overcome it.
i have a document with the following structure
<returndoc>
<doc>
...
</doc>
</returndoc>
and i got a Vector of Nodes. each node has the following structure
<section>
<caption>section name</caption>
...
</section>
my idea is to go through the whole vector and for each Node in the vector, append to the document. my code is
Element docelement = (Element) sendingdoc.getDocumentElement().getLastChild();
int sv=sectionnodesv.size();
for(int i=0;i<sv;i++)
{
Node sectionnode = (Node) sectionnodesv.elementAt(i);
docelement.appendChild(sectionnode);
}
but then i get the following error:
org.apache.crimson.tree.DomEx: WRONG_DOCUMENT_ERR: That node doesn't belong in this document.
and i'd traced it to the appendChild line.
pls advise what could have went wrong, or if there is any method to overcome it.