I'm confused. Are you asking about the org.w3c.dom.Document class? Because I don't see an isDeclaredNamespace() method in the documentation. There is an isDefaultNamespace() method, but it takes a String as a parameter and tells you whether that String is the URI of the default namespace. You didn't mention anything about passing a String to the method, and it does matter what String you pass it.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Why Document.isDefaultNamespace() is false?