Title: Message
Are you reusing the same DocumentResult object on two transformations by any chance? (Though a quick look at the code looks like this shouldn't be a problem).
 
If not could you send an example snippet of code and we can try fix it? It appears that a second <payloadID> element is being added to the document result when it already contains one. Are you using a special DocumentFactory?

James
----- Original Message -----
Sent: Friday, November 30, 2001 5:02 PM
Subject: [dom4j-user] Another error

Sorry for all the questions about errors... I just don't know enough about all this XML stuff yet.
 
I have a program which is trying to transform some XML.  The transform code I'm using is straight out of the dom4j cookbook.  The transformation works from Xalan's command line, but not in my program.  Below is the error message I'm seeing.  Can someone point me in the right direction?
 
 
org.dom4j.IllegalAddException: The node "org.dom4j.tree.DefaultElement@e57e8f [Element: <payloadID a
ttributes: []/>]" could not be added to the branch "null" because: Cannot add another element to thi
s Document as it already has  a root element of: payloadID
javax.xml.transform.TransformerException: org.dom4j.IllegalAddException: The node "org.dom4j.tree.De
faultElement@e57e8f [Element: <payloadID attributes: []/>]" could not be added to the branch "null"
because: Cannot add another element to this Document as it already has  a root element of: payloadID
 
        at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1226)
        at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:638)
        at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
        at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)

Reply via email to