I think I found an issue concerning Processing Instructions in dom4j 1.6.1.
When I create a document with this code :
xmlDoc = DocumentHelper.createDocument();
root = DocumentHelper.createElement("Descripteur");
xmlDoc.setRootElement(root);
if (!"".equals(revision)) {
ProcessingInstruction pi =
DocumentHelper.createProcessingInstruction(DSK_REVISION, revision);
xmlDoc.add(pi);
}
When I use xmlDoc.asXML(), the processing instruction is present at the end
of the String and it' OK.
When I create a document with this code :
xmlDoc = DocumentHelper.createDocument();
if (!"".equals(revision)) {
ProcessingInstruction pi =
DocumentHelper.createProcessingInstruction(DSK_REVISION, revision);
xmlDoc.add(pi);
}
root = DocumentHelper.createElement("Descripteur");
xmlDoc.setRootElement(root);
When I use xmlDoc.asXML(), the processing instruction has disapeared.
With the debugger, I see that xmlDoc.setRootElement(root); replace the first
element in content that was the PI.
In XML standard, a PI can be placed before the root element.
I think it's an issue.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user