comp.text.xml
[Top] [All Lists]

Question about validating schema with xml file

Subject: Question about validating schema with xml file
From: jh3an
Date: Wed, 2 Jul 2008 04:43:10 -0700 PDT
Newsgroups: comp.text.xml

Please give me your advice!

I made two files according to xml book, but when validating these two
files,
it gives me an error that I totally don't understand.

Is there a problem in these codes?

I checked xml and schema files through these following sites:
http://tools.decisionsoft.com/schemaValidate/
                                www.xmlme.com/Validator.aspx">http://www.xmlme.com/Validator.aspx

XML file:
<?xml version="1.0" encoding="utf-8"?>
<document xmlns:xsi="                                www.w3.org/2001/XMLSchema-instance"">http://www.w3.org/2001/XMLSchema-instance";
xmlns="kool" xsi:schemaLocation="test.xsd">
<number>89</number>
</document>

Schema file:
<?xml version="1.0" encoding="utf-8"?>
 <xsd:schema xmlns="kool" targetNamespace="kool" xmlns:xsd="http://
www.w3.org/2001/XMLSchema">

  <xsd:element name="document" type="documentType"/>

   <xsd:complexType name="documentType">
     <xsd:sequence>
      <xsd:element name="number" type="CustomNumber"/>
    </xsd:sequence>
  </xsd:complexType>

   <xsd:simpleType name="CustomNumber">
    <xsd:restriction base="xsd:integer">
     <xsd:maxInclusive value="1000"/>
    </xsd:restriction>
   </xsd:simpleType>
</xsd:schema>

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy