xml xsd에서 처음으로 작업하기.
다음과 같이 xsd 및 xml 데이터가 있습니다. 유효성을 검사하려고하면 오류가 발생합니다.
코드 및 오류.xml-xsd 유효성 검사 디버깅
제게 잘못 가고있는 것을 찾는 것을 도와주세요.
XSD :
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:t="http://www.m5net.com/mantle/configuration/connectors" targetNamespace="http://www.m5net.com/mantle/configuration/connectors" elementFormDefault="qualified">
<xsd:element name="Bullhorn" type="t:Bullhorn" nillable="true" />
<xsd:element name="Configuration" type="t:Configuration" nillable="true" />
<xsd:element name="Lync" type="t:Lync" nillable="true" />
<xsd:element name="SalesForce" type="t:SalesForce" nillable="true" />
<xsd:element name="ShoreTelCosmoMobility" type="t:ShoreTelCosmoMobility" nillable="true" />
<xsd:element name="ShoreTelCosmoScribe" type="t:ShoreTelCosmoScribe" nillable="true" />
<xsd:element name="ShoreTelFax" type="t:ShoreTelFax" nillable="true" />
<xsd:element name="ShoreTelMobility" type="t:ShoreTelMobility" nillable="true" />
<xsd:element name="ShoreTelScribe" type="t:ShoreTelScribe" nillable="true" />
<xsd:element name="ShoretelCosmoConference" type="t:ShoretelCosmoConference" nillable="true" />
<xsd:element name="ShoretelCosmoMobility" type="t:ShoretelCosmoMobility" nillable="true" />
<xsd:complexType name="Bullhorn">
<xsd:complexContent>
<xsd:extension base="t:Configuration">
<xsd:sequence>
<xsd:element name="AccountId" type="xsd:int" minOccurs="0" />
<xsd:element name="CorporationID" type="xsd:int" minOccurs="0" />
<xsd:element name="Password" type="xsd:string" minOccurs="0" nillable="true" />
<xsd:element name="PrivateLabelID" type="xsd:int" minOccurs="0" />
<xsd:element name="UserName" type="xsd:string" minOccurs="0" nillable="true" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Configuration">
<xsd:complexContent>
<xsd:restriction base="xsd:anyType">
<xsd:sequence />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Lync">
<xsd:complexContent>
<xsd:extension base="t:Configuration">
<xsd:sequence>
<xsd:element name="TrustedAppComputerFQDN" type="xsd:string" />
<xsd:element name="TrustedAppPort" type="xsd:int" />
<xsd:element name="TrustedAppComputerGRUU" type="xsd:string" />
<xsd:element name="CertificateFriendlyName" type="xsd:string" />
<xsd:element name="TrustedAppEndpointOwnerURI" type="xsd:string" />
<xsd:element name="RegistrarFQDN" type="xsd:string" />
<xsd:element name="RegistrarPort" type="xsd:int" />
<xsd:element name="AccountId" type="xsd:int" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="SalesForce">
<xsd:complexContent>
<xsd:extension base="t:Configuration">
<xsd:sequence>
<xsd:element name="IsSandbox" type="xsd:boolean" minOccurs="0" />
<xsd:element name="Password" type="xsd:string" minOccurs="0" nillable="true" />
<xsd:element name="Token" type="xsd:string" minOccurs="0" nillable="true" />
<xsd:element name="UserName" type="xsd:string" minOccurs="0" nillable="true" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="ShoreTelCosmoMobility">
<xsd:complexContent>
<xsd:extension base="t:Configuration">
<xsd:sequence>
<xsd:element name="AccountId" type="xsd:int" minOccurs="0" nillable="true" />
<xsd:element name="GroupId" type="xsd:string" minOccurs="0" nillable="true" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="ShoreTelCosmoScribe">
<xsd:complexContent>
<xsd:extension base="t:Configuration">
<xsd:sequence>
<xsd:element name="AccountId" type="xsd:int" minOccurs="0" nillable="true" />
<xsd:element name="GroupId" type="xsd:string" minOccurs="0" nillable="true" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="ShoreTelFax">
<xsd:complexContent>
<xsd:extension base="t:Configuration">
<xsd:sequence>
<xsd:element name="AccountId" type="xsd:int" minOccurs="0" />
<xsd:element name="ConfirmReceipt" type="xsd:int" minOccurs="0" />
<xsd:element name="ConfirmSent" type="xsd:int" minOccurs="0" />
<xsd:element name="IncludeCover" type="xsd:int" minOccurs="0" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="ShoreTelMobility">
<xsd:complexContent>
<xsd:extension base="t:Configuration">
<xsd:sequence>
<xsd:element name="AccountId" type="xsd:int" minOccurs="0" />
<xsd:element name="GroupID" type="xsd:string" minOccurs="0" nillable="true" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="ShoreTelScribe">
<xsd:complexContent>
<xsd:extension base="t:Configuration">
<xsd:sequence>
<xsd:element name="AccountId" type="xsd:int" minOccurs="0" />
<xsd:element name="PlanId" type="xsd:int" minOccurs="0" />
<xsd:element name="SendImmediate" type="xsd:int" minOccurs="0" />
<xsd:element name="SubplanId" type="xsd:int" minOccurs="0" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="ShoretelCosmoConference">
<xsd:complexContent>
<xsd:extension base="t:Configuration">
<xsd:sequence>
<xsd:element name="AccountId" type="xsd:int" minOccurs="0" nillable="true" />
<xsd:element name="StartConference" type="xsd:string" minOccurs="0" nillable="true" />
<xsd:element name="EndConference" type="xsd:string" minOccurs="0" nillable="true" />
<xsd:element name="WebLoginMode" type="xsd:string" minOccurs="0" nillable="true" />
<xsd:element name="Password" type="xsd:string" minOccurs="0" nillable="true" />
<xsd:element name="OutdialPrompt" type="xsd:boolean" minOccurs="0" />
<xsd:element name="NotifyChanges" type="xsd:boolean" minOccurs="0" />
<xsd:element name="NotificationEmail" type="xsd:string" minOccurs="0" nillable="true" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="ShoretelCosmoMobility">
<xsd:complexContent>
<xsd:extension base="t:Configuration">
<xsd:sequence>
<xsd:element name="AccountId" type="xsd:int" minOccurs="0" nillable="true" />
<xsd:element name="GroupId" type="xsd:string" minOccurs="0" nillable="true" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
XML :
<?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>
<EndConference>Moderator leaves</EndConference>
<NotificationEmail />
<NotifyChanges>false</NotifyChanges>
<OutdialPrompt>true</OutdialPrompt>
<Password />
<StartConference>Host Joins</StartConference>
<WebLoginMode>Name Only</WebLoginMode>
</ShoretelCosmoConference>
오류 :
XML Validation: Unexpected element(s):
{http://www.m5net.com/mantle/configuration/connectors}NotifyChanges. Location:
/*:ShoretelCosmoConference[1]/*:NotifyChanges[1]
나는
NotificationEmail
이 인으로 문제가, 요소의 순서라고 생각
'tns : Configuration'에 XSD 스키마를 제공 할 수 있습니까? 나는 이것이 문제라고 생각한다 – VMAtm
@Raghav 질문에'xsd'와'xml' 코드를 추가하면 문제 문장이 완성됩니다. –
어디서 오류가 있습니까? –