Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Clarifying about namespace URI and validation

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
I am mighty! And this is a mighty small ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic