This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
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: 782

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: 19973

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 agree. Here's the link:
subject: Why Document.isDefaultNamespace() is false?
It's not a secret anymore!