A-priory:
The noNamespaceSchemaLocation attribute refers to an XML Schema document that does not have a target namespace.
How will this attribute change the result of parsing?
For example, take this XML:
<?xml version="1.0"?> <name xmlns="http://www.example.com/name" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.com/name schema/schema.xsd" title="Mr."> <first>John</first> <middle>M</middle> <last>Doe</last> </name>
referring to this diagram:
<?xml version="1.0"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:target="http://www.example.com/name" targetNamespace="http://www.example.com/name" elementFormDefault="qualified"> <element name="name"> <complexType> <sequence> <element name="first" type="string"/> <element name="middle" type="string"/> <element name="last" type="string"/> </sequence> <attribute name="title" type="string"/> </complexType> </element> </schema>
I removed these namespace declarations from the schema:
xmlns:target="http://www.example.com/name" targetNamespace="http://www.example.com/name"
without even using the noNamespaceSchemaLocation attribute in the XML link, no error was selected. Why do we even need this attribute?
Jops
source share