File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Why Document.isDefaultNamespace() is false?

Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

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 ?


Regards,

Pho
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18992
    
    8

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: http://aspose.com/file-tools
 
subject: Why Document.isDefaultNamespace() is false?