Jump to content

Question about where namespaces have to match...


MatthewRed

Recommended Posts

Hey there,My company uses a *somewhat* xml and schema liike format for many of their data and configuration files. It is my task to write a converter to valid and qualified xml and xsd files.My question (premise): looking within the xml files (under Referencing a Schema in an XML Document), there is a part "<note xmlns="http://www.w3schools.com"".'>http://www.w3schools.com"". I understand that this is the namespace which the root element, and all child elements operate under. Further, there is a "xsi:schemaLocation="http://www.w3schools.com" attribute. Note that these are only relevant code fragments.Further, within the schema there is a "targetNamespace="http://www.w3schools.com"" and a "xmlns="http://www.w3schools.com"" set of attributes within the root element of the schema file (all this stuff is taken from the link above).My question (actual): which of these need to match? I am not abundantly clear what the default namespace in the schema file is for, or the default namespace expressed in the schemaLocation attribute, w3schools doesn't explain it too clearly and I cannot yet find a clear reference on the subject.Thanks in advance-

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...