aspose file tools*
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
Author

Question on default namespace

Balaji Natarajan
Greenhorn

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

<purchaseorder name="testBook"
xmlns:book="http://www.sample.book.com/book"
xmlns="http://www.sample.order.com/order">

<order>
<ordernumber>101010</ordernumber>
</order>

<book:bookdetails>
<numofpages>100</numofpages>
</book:bookddetails>
</purchaseorder>

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="http://www.sample.book.com/book">
<numofpages>100</numofpages>
</bookddetails>


Others can verify this also...

-Harsha
Balaji Natarajan
Greenhorn

Joined: Dec 05, 2002
Posts: 28
Hi Harsha

Thanks for your response. I got your point

Thanks
Balaji.
 
 
subject: Question on default namespace