• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding XML NameSpace convention  RSS feed

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

while declaring XML NameSpace we are using URI which looks like "http:\\www.w3.org\2001\XMLSchema"

My question is why should we use Http formate even though it is not hooking in to that address.
Why cant we use the formate like company_name/project_name/etc...(company name & project will be unique always...so i hope we can use it)

ofcourse,i know http formate is specified by w3 community,but still i hope there might be a strong reason behind using Http formate(insted of ordinary package name)over other naming convention...can any one of you explain the significance of using Http formate in XML nameSpace
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Couple of reasons for using URL format for namespace

- URL is well known format
- Standard
- More importantly it's guaranteed to be unique.
- Language independent (Java isn't only language suppose to work on XML)
- Easy to associate with companies Web URL and avoid naming conflicts
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!