[Solved] xml-xsd validation debugging


I think that the problem is in the order of the elements, as the NotificationEmail is a last one in your schema. Try to reorder the data, like this:

<?xml version="1.0" encoding="UTF-8"?>
<ShoretelCosmoConference xmlns="http://www.m5net.com/mantle/configuration/connectors" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
   <AccountId>13284</AccountId>
   <StartConference>Host Joins</StartConference>
   <EndConference>Moderator leaves</EndConference>
   <WebLoginMode>Name Only</WebLoginMode>
   <Password />
   <OutdialPrompt>true</OutdialPrompt>
   <NotifyChanges>false</NotifyChanges>
   <NotificationEmail />
</ShoretelCosmoConference>

I use this validation for your schema:

W3C XML Schema (XSD) Validation online

And it says this error occurs:

Error – Line 6, 19: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 19; cvc-complex-type.2.4.d: Invalid content was found starting with element ‘NotifyChanges’. No child element is expected at this point.

I’ve rewrote the xsd-schema, and I found out that the order does matter:

<?xml version="1.0" encoding="UTF-8"?>
<ShoretelCosmoConference xmlns="http://www.m5net.com/mantle/configuration/connectors" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
   <AccountId>13284</AccountId>
   <StartConference>Host Joins</StartConference>
   <EndConference>Moderator leaves</EndConference>
   <WebLoginMode>Name Only</WebLoginMode>
   <Password />
   <OutdialPrompt>true</OutdialPrompt>
   <NotifyChanges>false</NotifyChanges>
   <NotificationEmail />
</ShoretelCosmoConference>

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.m5net.com/mantle/configuration/connectors" elementFormDefault="qualified" targetNamespace="http://www.m5net.com/mantle/configuration/connectors">
   <xs:complexType name="ShoretelCosmoConference">
            <xs:sequence>
               <xs:element minOccurs="0" name="AccountId" nillable="true" type="xs:int" />
               <xs:element minOccurs="0" name="StartConference" nillable="true" type="xs:string" />
               <xs:element minOccurs="0" name="EndConference" nillable="true" type="xs:string" />
               <xs:element minOccurs="0" name="WebLoginMode" nillable="true" type="xs:string" />
               <xs:element minOccurs="0" name="Password" nillable="true" type="xs:string" />
               <xs:element minOccurs="0" name="OutdialPrompt" type="xs:boolean" />
               <xs:element minOccurs="0" name="NotifyChanges" type="xs:boolean" />
               <xs:element minOccurs="0" name="NotificationEmail" nillable="true" type="xs:string" />
            </xs:sequence>
   </xs:complexType>
   <xs:element name="ShoretelCosmoConference" nillable="true" type="tns:ShoretelCosmoConference" />
</xs:schema>

Result:

The XML is Well Formed and Valid.

4

solved xml-xsd validation debugging