Hi,
Can someone please clarify for me..the following: I am using xschema(.xsd) with an xml file in IE6. I have installed msxml4 on my machine as well as the xml validator for IE which gives you the option to validate xml files when you right click the browser window. My problem is I cant get IE to validate my xml file against my xsd file.. it seems to just check the xsd for well-formedness only. When I explicitly do something wrong in the xml file according to the xschema i dont get an error. Is this right? MSDN explicitly says it supports xschema "Extensive support for the final World Wide Web Consortium (W3C) XML Schema (XSD) Recommendation. " in msxml4.. so im quite baffled. The validation does work when I use xdr instead... I've attached my files for reference.. but I would appreciate if someone could shed some light on this issue. thanks Chamindu |
<?xml version ="1.0"?> <!--Generated by XML Authority. Conforms to w3c http://www.w3.org/2001/XMLSchema--> <xsd:schema xmlns="http://www.w3c.org/2001/XMLSchema" xmlns:xsd="http://www.w3c.org/2001/XMLSchema-datatypes" targetNamespace="http://www.example.com"> <xsd:element name = "catalogue"> <xsd:complexType> <xsd:sequence> <xsd:element ref = "book" minOccurs = "1" maxOccurs = "unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name = "book"> <xsd:complexType> <xsd:sequence> <xsd:element ref = "author" minOccurs = "1" maxOccurs = "unbounded"/> <xsd:element ref = "cd" minOccurs = "0" maxOccurs = "unbounded"/> <xsd:element ref = "review" minOccurs = "0" maxOccurs = "unbounded"/> <xsd:element ref = "publisher"/> <xsd:element ref = "bookCover" minOccurs = "0" maxOccurs = "1"/> <xsd:element ref = "bookTableOfContents" minOccurs = "0" maxOccurs = "1"/> <xsd:element ref = "bookYearPublished" minOccurs = "0" maxOccurs = "1"/> <xsd:element ref = "bookWebPage" minOccurs = "0" maxOccurs = "1"/> <xsd:element ref = "bookQuantity"/> <xsd:element ref = "bookNumberSold"/> <xsd:element ref = "bookPrice"/> <xsd:element ref = "bookDescription" minOccurs = "0" maxOccurs = "1"/> <xsd:element ref = "newBook"/> <xsd:element ref = "bookTitle"/> <xsd:element ref = "bookCategory"/> </xsd:sequence> <xsd:attribute name = "id" use = "required" type = "ID"/> </xsd:complexType> </xsd:element> <xsd:element name = "cd"> <xsd:complexType> <xsd:sequence> <xsd:element ref = "cdContents"/> <xsd:element ref = "cdTitle"/> </xsd:sequence> <xsd:attribute name = "id" use = "required" type = "ID"/> </xsd:complexType> </xsd:element> <xsd:element name = "bookCover" type = "uri"/> <xsd:element name = "bookTableOfContents"> <xsd:complexType> <xsd:sequence> <xsd:element ref = "tocSection" minOccurs = "1" maxOccurs = "unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name = "bookWebPage" type = "uri"/> <xsd:element name = "bookQuantity" type = "integer"/> <xsd:element name = "bookNumberSold" type = "integer"/> <xsd:element name = "bookPrice" type = "float"/> <xsd:element name = "bookDescription" type = "string"/> <xsd:element name = "newBook" type = "boolean"/> <xsd:element name = "bookTitle" type = "string"/> <xsd:element name = "bookCategory"> <xsd:complexType> <xsd:attribute name = "categoryName" use = "required"> <xsd:simpleType base = "string"> <xsd:enumeration value = "Art and Hobbies"/> <xsd:enumeration value = "Autobography and Biography"/> <xsd:enumeration value = "Business and Management"/> <xsd:enumeration value = "Childrens"/> <xsd:enumeration value = "Education"/> <xsd:enumeration value = "Entertainment"/> <xsd:enumeration value = "Fiction"/> <xsd:enumeration value = "Health"/> <xsd:enumeration value = "House and Garden"/> <xsd:enumeration value = "Information Technology"/> <xsd:enumeration value = "Literature"/> <xsd:enumeration value = "Non Fiction"/> <xsd:enumeration value = "Spirituality"/> <xsd:enumeration value = "Sport"/> <xsd:enumeration value = "Travel"/> </xsd:simpleType> </xsd:attribute> </xsd:complexType> </xsd:element> <xsd:element name = "bookYearPublished" type = "integer"/> <xsd:element name = "tocSectionName" type = "string"/> <xsd:element name = "tocSectionLevel" type = "integer"/> <xsd:element name = "tocSection"> <xsd:complexType> <xsd:sequence> <xsd:element ref = "tocSectionName"/> <xsd:element ref = "tocSectionLevel"/> <xsd:element ref = "tocParentSection"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name = "cdContents" type = "string"/> <xsd:element name = "cdTitle" type = "string"/> <xsd:element name = "test" type = "string"/> <xsd:element name = "tocParentSection" type = "integer"/> </xsd:schema>
<?xml version ="1.0"?> <mycat xmlns:cat="http://www.example.com/catalogue.xsd"> <cat:catalogue> <!-- (book+ )--> <book id = "1"><!-- (author+ , cd* , review* , publisher , bookCover? , bookTableOfContents? , bookYearPublished? , bookWebPage? , bookQuantity , bookNumberSold , bookPrice , bookDescription? , newBook , bookTitle , bookCategory )--> <author> <authorFirstName>bob</authorFirstName> <authorLastName>bob</authorLastName> </author> <cd id = "1"><!-- (cdContents , cdTitle )--> <cdContents>string</cdContents> <cdTitle>string</cdTitle> </cd> <publisher id = "1"><!-- (publisherName , publisherLocation? , publisherHomePage? )--> <publisherName>string</publisherName> <publisherLocation>string</publisherLocation> <publisherHomePage>www.blah.com</publisherHomePage> </publisher> <bookCover>www.blah.com</bookCover> <bookTableOfContents><!-- (tocSection+ )--> <tocSection><!-- (tocSectionName , tocSectionLevel , tocParentSection )--> <tocSectionName>section1</tocSectionName> <tocSectionLevel>1</tocSectionLevel> <tocParentSection>0</tocParentSection> </tocSection> </bookTableOfContents> <bookYearPublished>1924</bookYearPublished> <bookWebPage>www.blah.com</bookWebPage> <bookQuantity>124</bookQuantity> <bookNumberSold>124</bookNumberSold> <bookPrice>45.45/bookPrice</bookPrice> <bookDescription>Amid the technical hoopla over the Extensible Markup Language (XML), many managers and executives find themselves scratching their heads and wondering what the new language means to them. In XML: A Manager's Guide, author Kevin Dick offers an executive summary of this exciting new technology that...</bookDescription> <newBook>true</newBook> <bookCategory categoryName = "string">Education</bookCategory> </book> </cat:catalogue> </mycat>