You'll have to remove the namespace from every element in the tree. Try
something like this:
<code>
setDefaultNamespace( document.getRootElement(), null);
private void setDefaultNamespace( AbstractElement element, String namespace)
{
List elements = element.elements();
for ( int i = 0; i < elements.size(); i++) {
setDefaultNamespace( (AbstractElement)elements.get( i), namespace);
}
if ( namespace == null || namespace.trim().length() == 0) {
element.setNamespace( null);
} else {
element.setNamespace( Namespace.get( namespace));
}
}
</code>
Good luck,
Edwin
----- Original Message -----
From: "Stefan Lischke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 25, 2003 10:08 AM
Subject: [dom4j-user] how to remove default namespace !!!
hi,
I want to remove the standard / default namespace from a
org.dom4j.Document after parsing. How can i do this?
Is this possible?
I tried it with removing it from rootElement, but it does not work.
Every Namespace can be removed but not the default namespace.
Please help me
thanx stefan
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user