This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "XML Schema:  Use of Import" Watch "XML Schema:  Use of Import" New topic
Author

XML Schema: Use of Import

Ashok Kumar Babu
Ranch Hand

Joined: Jul 25, 2006
Posts: 129
Hello,

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: 11437
    
  87

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
    
    1
Hi!
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 "http://www.Monson-Haefel.com/jwsbook/ADDR".
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: http://www.slideshare.net/krizsan
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1176
Ashok,

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

Regards,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
 
wood burning stoves
 
subject: XML Schema: Use of Import