jQuery in Action, 3rd edition
The moose likes XML and Related Technologies and the fly likes Why Document.isDefaultNamespace() is false? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Why Document.isDefaultNamespace() is false?" Watch "Why Document.isDefaultNamespace() is false?" New topic

Why Document.isDefaultNamespace() is false?

Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 776

I have an XML instance with a declared default namespace.

When I parse it with the DocumentBuilder, it returns me a Document reference. And calling Document.isDeclaredNamespace() always returns false; which is wrong. Why ?


Paul Clapham

Joined: Oct 14, 2005
Posts: 19728

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?
It's not a secret anymore!