我在根据其架构验证我的xml文档时遇到错误。请帮忙。
以下是我要验证的XML文档。
<?xml version="1.0" encoding="utf-8"?>
<QuestionForm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd">
<Overview>
<Text>This is overview</Text>
</Overview>
<Question>
<QuestionIdentifier>nextmove</QuestionIdentifier>
<DisplayName>Display Name</DisplayName>
<IsRequired>true</IsRequired>
<QuestionContent>
<Text>The Main Question will go here?</Text>
</QuestionContent>
<AnswerSpecification>
<FreeTextAnswer>
<Constraints>
<IsNumeric minValue="0" maxValue="9999" />
<Length minLength="0" maxLength="4" />
</Constraints>
<NumberOfLinesSuggestion>1</NumberOfLinesSuggestion>
</FreeTextAnswer>
</AnswerSpecification>
</Question>
</QuestionForm>
Here is the link for XML Schema document.
以下是错误消息
未处理的异常:Amazon.WebServices.MechanicalTurk.Exceptions.ParseErrorException:在请求中解析XML问题或答案数据时出错。 PL 轻松确保数据格式正确并根据适当的架构进行验证。详细信息:cvc-complex-type.2.4.a:从element开始发现无效内容 &#39; QuestionContent&#39 ;.其中一个{&#34; http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd&#34;:QuestionIdentifier}&#39;是期待。 (14084243 91173 s)
在Amazon.WebServices.MechanicalTurk.MTurkClient.ProcessErrors(ErrorsError [] errors,Object ret,OperationRequest opsReq)
在Amazon.WebServices.MechanicalTurk.MTurkClient.SendRequest(Object req)
在Amazon.WebServices.MechanicalTurk.MTurkClient.CreateHIT(CreateHITRequest request)
[1]: http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd
答案 0 :(得分:0)
您显示的输入没有指示错误。它对您指向的架构有效。
要么向验证器提交输入,而不是您显示的输入,要么验证器使用的是您指向的模式以外的其他模式。无论哪种方式,您问题的唯一解决方案是确保验证器实际上使用您希望它使用的输入,而不是其他一些输入。