我正在尝试进行xml验证,但在进行xml验证时遇到以下错误。
你可以帮助我,为什么我在验证时收到错误
。得到此错误“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:FCA0989FBA745C0A771349097015870@apache.org</ParagraphText>
<Status>Draft</Status>
<OldParagraphId>
<CountryCode>111</CountryCode>
<SubsidiaryCode>01</SubsidiaryCode>
<ObjectId>1111</ObjectId>
<LanguageCode>ENU</LanguageCode>
<TextVersionId>1</TextVersionId>
</OldParagraphId>
</Paragraphs>
答案 0 :(得分:0)
您的架构声明OldParagraphId必须在ObjectId之前有一个LanguageCode,但在您的实例中它们以相反的顺序出现。您需要更改架构或实例。