I was getting following error
org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 55;
SchemaLocation: schemaLoca
The schemaLocation
attribute references an XML Schema document for a namespace.
Basically when you type:
xmlns:expns="http://www.example.com"
xsi:schemaLocation="http://www.example.com
http://www.example.com/schema/example.xsd"
You are saying: "I'm going to use the prefix expns
for the elements of the namespace http://www.example.com
. Also, so you can validate those elements, get the XSD Schema file for http://www.example.com
in http://www.example.com/schema/example.xsd
"
So, in other words, the format is:
xsi:schemaLocation="namespace-a where_to_get_the_xsd_for_namespace-a
namespace-b where_to_get_the_xsd_for_namespace-b
namespace-c where_to_get_the_xsd_for_namespace-c"
And so on.
That's why it must me an even number.
More info and examples can be found here.