Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
XSD中定义的XML属性未正确验证_Xml_Xsd - Fatal编程技术网

XSD中定义的XML属性未正确验证

XSD中定义的XML属性未正确验证,xml,xsd,Xml,Xsd,我认为我正确地创建了这个XSD,但是当我在VisualStudio上运行它来验证它时。它声称它无法找到这些属性,尽管它们在我的XSD文件中有明确的定义。我做错了什么 以下是我的XML: 要想让它生效,我首先必须(a)为lettfile添加元素声明,以及(b)让实例文档和模式使用相同的名称空间。完成此操作后,我会收到以下错误(来自Saxon): test.xml第2行第48列出现验证错误: 验证字母//@RequestID:Value“”与类型的minLength方面“1”冲突 属性请求ID 正

我认为我正确地创建了这个XSD,但是当我在VisualStudio上运行它来验证它时。它声称它无法找到这些属性,尽管它们在我的XSD文件中有明确的定义。我做错了什么

以下是我的XML:


要想让它生效,我首先必须(a)为lettfile添加元素声明,以及(b)让实例文档和模式使用相同的名称空间。完成此操作后,我会收到以下错误(来自Saxon):

test.xml第2行第48列出现验证错误: 验证字母//@RequestID:Value“”与类型的minLength方面“1”冲突 属性请求ID 正在验证/lettfile[1]/Letter[1] 看见http://www.w3.org/TR/xmlschema-2/#cvc-复杂类型条例草案第3条 test.xml第2行第48列的验证错误: 验证信函/@CertifiedMail:无法将字符串“”转换为布尔值 正在验证/lettfile[1]/Letter[1] 看见http://www.w3.org/TR/xmlschema-2/#cvc-复杂类型条例草案第3条 test.xml第9行第92列的验证错误: 元素上不允许使用属性@NumberOfMonthPastDue 正在验证/lettfile[1]/Letter[1]/Account[1] 看见http://www.w3.org/TR/xmlschema-1/#cvc-复杂类型条例草案第3条 test.xml第9行第92列的验证错误: 元素上不允许使用Attribute@Custom.LienPosition 正在验证/lettfile[1]/Letter[1]/Account[1] 看见http://www.w3.org/TR/xmlschema-1/#cvc-复杂类型条例草案第3条 test.xml第12行第80列出现验证错误: 正在验证PaymentHistory/@Count:无法将长度为零的字符串转换为整数 正在验证/lettfile[1]/Letter[1]/Account[1]/PaymentHistory[1] 看见http://www.w3.org/TR/xmlschema-2/#cvc-复杂类型条例草案第3条 test.xml第17行第206列的验证错误: 在元素的内容中:内容模型不允许元素 在元素之后立即出现。此时不允许有其他元素 这一点。 正在验证/lettfile[1]/Letter[1]/Account[1]/LoanActivity[1] 看见http://www.w3.org/TR/xmlschema-1/#cvc-复杂类型第2.4条 test.xml第2行第48列的验证错误: 元素内容中:元素不存在 正在验证/lettfile[1]/Letter[1] 看见http://www.w3.org/TR/xmlschema-1/#cvc-示范小组第3条 test.xml第2行第48列的验证错误: 元素内容中:元素不存在 正在验证/lettfile[1]/Letter[1] 看见http://www.w3.org/TR/xmlschema-1/#cvc-示范小组第3条
为什么不指定哪些属性,或者在请求错误帮助时发布完整的错误消息?
Validation error on line 2 column 48 of test.xml:
  Validating Letter//@RequestID: Value "" contravenes the minLength facet "1" of the type of
  attribute RequestID
  Validating /LetterFile[1]/Letter[1]
  See http://www.w3.org/TR/xmlschema-2/#cvc-complex-type clause 3
Validation error on line 2 column 48 of test.xml:
  Validating Letter//@CertifiedMail: The string "" cannot be cast to a boolean
  Validating /LetterFile[1]/Letter[1]
  See http://www.w3.org/TR/xmlschema-2/#cvc-complex-type clause 3
Validation error on line 9 column 92 of test.xml:
  Attribute @NumberOfMonthsPastDue is not allowed on element <Account>
  Validating /LetterFile[1]/Letter[1]/Account[1]
  See http://www.w3.org/TR/xmlschema-1/#cvc-complex-type clause 3
Validation error on line 9 column 92 of test.xml:
  Attribute @Custom.LienPosition is not allowed on element <Account>
  Validating /LetterFile[1]/Letter[1]/Account[1]
  See http://www.w3.org/TR/xmlschema-1/#cvc-complex-type clause 3
Validation error on line 12 column 80 of test.xml:
  Validating PaymentHistory//@Count: Cannot convert zero-length string to an integer
  Validating /LetterFile[1]/Letter[1]/Account[1]/PaymentHistory[1]
  See http://www.w3.org/TR/xmlschema-2/#cvc-complex-type clause 3
Validation error on line 17 column 206 of test.xml:
  In content of element <Account>: The content model does not allow element <LoanActivity>
  to appear immediately after element <PaymentHistory>. No further elements are allowed at
  this point. 
  Validating /LetterFile[1]/Letter[1]/Account[1]/LoanActivity[1]
  See http://www.w3.org/TR/xmlschema-1/#cvc-complex-type clause 2.4
Validation error on line 2 column 48 of test.xml:
  In content of element <Letter>: element <Property> is not present
  Validating /LetterFile[1]/Letter[1]
  See http://www.w3.org/TR/xmlschema-1/#cvc-model-group clause 3
Validation error on line 2 column 48 of test.xml:
  In content of element <Letter>: element <Recipients> is not present
  Validating /LetterFile[1]/Letter[1]
  See http://www.w3.org/TR/xmlschema-1/#cvc-model-group clause 3