Hello,
I am trying to create a simple XML which refers to an XML Schema file, but it looks like the XML doesn't care about the Schema it refers to (both files are sitting on the same directory).
Here is my test.xml file:
Here is my schema.xsd:
Now, if I change for example:
<xs:element name="to" type="xs:string"/>
to:
<xs:element name="to" type="xs:decimal"/>
The test.xml is still working and doesn't throw an error that to should be decimal.
What I am doing wrong here?
I am trying to create a simple XML which refers to an XML Schema file, but it looks like the XML doesn't care about the Schema it refers to (both files are sitting on the same directory).
Here is my test.xml file:
Code:
<?xml version="1.0"?>
<note
xmlns="[URL unfurl="true"]http://www.me.com"[/URL]
xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xsi:schemaLocation="[URL unfurl="true"]http://www.me.com[/URL] schema.xsd">
<to>Tove</to>
<from>Me</from>
<heading>Reminder</heading>
<body>Hello!</body>
</note>
Here is my schema.xsd:
Code:
<?xml version="1.0"?>
<xs:schema xmlns:xs="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL]
targetNamespace="[URL unfurl="true"]http://www.me.com"[/URL]
xmlns="[URL unfurl="true"]http://www.me.com"[/URL]
elementFormDefault="qualified">
<xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:decimal"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Now, if I change for example:
<xs:element name="to" type="xs:string"/>
to:
<xs:element name="to" type="xs:decimal"/>
The test.xml is still working and doesn't throw an error that to should be decimal.
What I am doing wrong here?