aspose file tools
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes XML Schema:  Use of Import Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "XML Schema:  Use of Import" Watch "XML Schema:  Use of Import" New topic

XML Schema: Use of Import

Ashok Kumar Babu
Ranch Hand

Joined: Jul 25, 2006
Posts: 129

In the below PO Schema, I understand addr type of address schema. Why do we import it when we already mentioned in the schema definition? I dont get that point clearly. Can some one explain me the key point?

Ashok<br /> <br />SCJP 91%<br />SCWCD 88%
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11705

A very recent change to CodeRanch was the ability to recognize the type of code being posted, if you set it. You might also consider formatting your code so that it is easier for others to read. Finally, since it is almost impossible for for forum software to allow markup within the code you post, you are probably better referencing the line numbers that you have questions about, rather than trying to put them in bold.

Putting all this into practice:

Ashok wrote:I understand addr type of address schema. Why do we import it when we already mentioned in the schema definition?

Or: Why do we import it in line 7 when we already mentioned in the schema definition in line 5?

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
At line 5, the XML namespace prefix "addr" is declared. A namespace prefix is only a shorthand for the full namespace name, which in this case is "".
At line 7, the XML schema is imported, in order to be able to use the types etc defined in that schema.
Best wishes!

My free books and tutorials:
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180

The Trouble With XML Schema Imports and Includes is a good article. Doesn't seem however, to answer your question.


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Don't get me started about those stupid light bulbs.
subject: XML Schema: Use of Import
It's not a secret anymore!