Is xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" a special case in XML?
- by Bytecode Ninja
When we use a namespace, we should also indicate where its associated XSD is located at, as can be seen in the following example:
<?xml version="1.0"?>
<Artist BirthYear="1958"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.webucator.com/Artist"
xsi:schemaLocation="http://www.webucator.com/Artist Artist.xsd">
<Name>
<Title>Mr.</Title>
<FirstName>Michael</FirstName>
<LastName>Jackson</LastName>
</Name>
</Artist>
Here, we have indicated that Artist.xsd should be used for validating the http://www.webucator.com/Artist namespace. However, we are also using the http://www.w3.org/2001/XMLSchema-instance namespace, but we have not specified where its XSD is located at. How do XML parsers know how to handle this namespace?
Thanks in advance.