File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Question on default namespace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Question on default namespace" Watch "Question on default namespace" New topic

Question on default namespace

Balaji Natarajan

Joined: Dec 05, 2002
Posts: 28
Assume an xml instance as below

<purchaseorder name="testBook"



In the above instance, what will be namespace for the <order> and <numofpages> elements??

will numofpages belong to the namespace "book" as it is nested inside that??
Harsha Jay
Ranch Hand

Joined: Jul 23, 2001
Posts: 177
From looking at your instance document;

<order> belongs to default namespace thats straightforward.

<numofpages> also belongs to the default namespace.

if the <bookdetails> was declared as follows, the <numofpages> element would certainly belong to the 'book' namespace.

<bookdetails xmlns="">

Others can verify this also...

Balaji Natarajan

Joined: Dec 05, 2002
Posts: 28
Hi Harsha

Thanks for your response. I got your point

I agree. Here's the link:
subject: Question on default namespace
jQuery in Action, 3rd edition