Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML Schema: Use of Import

 
Ashok Kumar Babu
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?



 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11945
212
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ashok,

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

Regards,
Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic