• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML Schema: Use of Import

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?



 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic