2012-10-01 25 views
0

我正在嘗試執行xml驗證,但在執行xml驗證時出現以下錯誤。Webservice模式驗證不起作用

能否請你幫我,爲什麼我收到了錯誤,而驗證

。獲取此錯誤「cvc-complex-type.2.4.a:發現無效的內容是從元素'ObjectId'開始的,預計會有'{LanguageCode}'之一。」

schema: 
------- 
<xs:complexType name="Paragraph"> 
     <xs:sequence> 
      <xs:element name="ParagraphId" type="tns:ParagraphId" maxOccurs="unbounded" /> 
      <xs:element minOccurs="0" name="Name" type="string"/> 
      <xs:element minOccurs="0" name="Description" type="string"/> 
      <xs:element minOccurs="0" name="SectionNumber" type="string"/> 
      <xs:element minOccurs="0" name="Editable" type="xs:boolean"/> <!-- If Y then This Paragraph is editable. --> 
      <xs:element minOccurs="0" name="ParagraphText" type="ref:swaRef"/> 
      <xs:element maxOccurs="1" minOccurs="0" name="Status" nillable="true" type="tns:StatusType"/> 
      <!-- retrieveParagraph() : List of variables of this paragraph and the following are retrieved based on this 「ReturnVariable」 flag. --> 
      <xs:element maxOccurs="unbounded" minOccurs="0" name="Variables" nillable="false" type="tns:Variable"/> 
      <xs:element minOccurs="0" name="OldParagraphId" type="tns:ParagraphId" maxOccurs="unbounded" /> <!-- It will be used to get effective time stamp of existing paragraph on which we are creating Modification --> 
      <xs:element minOccurs="0" name="Action" type="xs:string"/> 
      <xs:element minOccurs="0" name="LockedBy" type="string"/> 
     </xs:sequence> 
    </xs:complexType> 

    <xs:complexType name="ParagraphId"> 
     <xs:sequence> 
      <xs:element name="CountryCode" type="tns:CountryCodeType" /> 
      <xs:element default="00" name="SubsidiaryCode" type="tns:SubsidiaryCodeType" /> 
      <xs:element name="LanguageCode" type="string" /> 
      <xs:element name="ObjectId" type="string" /> 
      <xs:element name="TextVersionId" type="string" /> 
     </xs:sequence> 
    </xs:complexType> 

xml: 
--- 
<Paragraphs> 
       <ParagraphId> 
        <CountryCode>111</CountryCode> 
        <SubsidiaryCode>01</SubsidiaryCode> 
        <LanguageCode>AAA</LanguageCode> 
        <ObjectId>MMMM</ObjectId> 
        <TextVersionId>1</TextVersionId> 
       </ParagraphId> 
       <Description>Title</Description> 
       <SectionNumber>2</SectionNumber> 
       <ParagraphText>cid:urn:uuid:[email protected]</ParagraphText> 
       <Status>Draft</Status> 
       <OldParagraphId> 
        <CountryCode>111</CountryCode> 
        <SubsidiaryCode>01</SubsidiaryCode> 
        <ObjectId>1111</ObjectId> 
        <LanguageCode>ENU</LanguageCode> 
        <TextVersionId>1</TextVersionId> 
       </OldParagraphId> 
      </Paragraphs> 

回答

0

你的模式說,OldParagraphId必須具備的ObjectId前的語言代碼,但在你的情況下,他們出現在相反的順序。您需要更改您的模式或您的實例。