Jump to content

Question about where namespaces have to match...


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 post
Share on other sites
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...