I am unable to understand certain behavior of declaring XML schema .
Question This xml schema works fine :
*<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org" xmlns:ab="http://test.com"
targetNamespace="http://www.example.org"
elementFormDefault="qualified">
<xsd:element name="simple1" type="complexType1"/>
<xsd:complexType name="complexType1">
<xsd:sequence>
<xsd:element name="element1" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>*
But if I change targetnamespace anything apart from http://www.example.org , the schema does not find complexType1. Why this happens. This does not work.
*<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org" xmlns:ab="http://test.com"
targetNamespace="http://www.example.org99999"
elementFormDefault="qualified">
<xsd:element name="simple1" type="complexType1"/>
<xsd:complexType name="complexType1">
<xsd:sequence>
<xsd:element name="element1" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>*
Thanks in advance