validating an instance doc

admin

Administrator
Staff member
If I create an xml schema document and reference it in an xml instance documentI should see an error message of some sort if anything in the xml instancedoc violates the schema right?For example the following is an xml instance doc I am testing.<?xml version="1.0"?><Demo xmlns="http://www.demo.org"xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"xsi:schemaLocation="http://www.demo.org demo.xsd"><A>10</A><B>sds</B></Demo>Here is the coressponding schema<?xml version="1.0"?><xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"targetNamespace="http://www.demo.org"xmlns="http://www.demo.org"elementFormDefault="qualified"><xsd:element name="Demo"><xsd:complexType><xsd:sequence><xsd:element name="A" type="xsd:integer"/><xsd:element name="B" type="xsd:integer"/></xsd:sequence></xsd:complexType></xsd:element></xsd:schema>Note that the element B is of type integer but in the xml instance doc Iput in a string value. When I load the xml document in the browser I donot get an error.Could it be due to the fact that the url <!-- m --><a class="postlink" href="http://www.w3.org/2000/10/XMLSchema-instancegives">http://www.w3.org/2000/10/XMLSchema-instancegives</a><!-- m --> me an error when it tries to load?Thanks
 
Back
Top