1. The XSD file defines the element and type in a namespace. The type defined here is used by element (this namespace or another namespace), but not by XML files.
2. the XML file has a unique root element.
3. When creating an XML file, you can specify which namespaces are used in the root element to use the element.
Discussion: root element also belongs to a namespace. Because other elements are sub-elements of this root element, do you only need
Root element namespace? This depends on the definition of the type of the root element.
If you reference the element or type of another namespace in the Type Definition of the root element (and the element in the type definition), you need to introduce other namespaces.
In summary, there is no direct link between the XML file and the XSD file. They are associated through namespace, that is
Add element use element
XSD file --------------------------> namepsae ---------------------------> XML file