• 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

Clarifying about namespace URI and validation

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"It's important to remember that the URI used for the XML namespace should be unique to that markup language, but it doesn't have to point to an actual resource or document." states RM. I understand the comment and get the idea that the namespace-engendered uniqueness will ensure that there are no collisions in names so the prefix is more important than the actual presence. But am I right in saying that if we are validating a document then the schemaLocation URI has to point to an actual schema but the URI for the other standard namespaces still do not have to physically point to anything because the document is only validated against the schema defined in the schemaLocation and the rest of the namespaces are just there to confer uniqueness. Please clarify.
 
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!
Yes, I think you understood it correctly.
The namespace name is just a string (URI) that may happen to look like an URL. Some examples:


The XML schema specification says that the second URI in the schemaLocation attribute value is only a hint on where the schema document for the namespace in question may be found. Reference: http://www.w3.org/TR/xmlschema-0/#schemaLocation
Best wishes!
 
Rajeev Trikha
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ivan for the clarification and your study notes. I am currently going through your study notes and they seem to be a fairly comprehensive resource.

For validation, the parser has to know the actual details of the schema, so "the schemaLocation attribute value is only a hint on where the schema document for the namespace in question may be found" presumably just means that either use the given location or if you have already obtained the schema details and put them in your cache then use that for efficiency.
reply
    Bookmark Topic Watch Topic
  • New Topic