Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
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
It's not a secret anymore!