简体   繁体   English

SAXParseException:cvc-elt.1:找不到元素'Document'的声明

[英]SAXParseException: cvc-elt.1: Cannot find the declaration of element 'Document'

I have this issue 我有这个问题

Caused by: 

 org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'Document'.

The document in XML XML文档

<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:swift:xsd:setr.010.001.03">

My XSD 我的XSD

<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Standards Editor (build:R1.0.42.1) on 2013 May 24 16:27:15, ISO 20022 version : 2013-->
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:setr.010.001.03" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:setr.010.001.03">
    <xs:element name="Document" type="Document"/>

I have a problem of ns. 我有一个ns的问题。 Any idea please ? 有什么想法吗?

Regards 问候

Your posted XML and XSD are poorly formatted (currently invisible, in fact) and incomplete (as seen by peaking behind the scenes of your post). 您发布的XML和XSD的格式不正确(实际上目前是不可见的)和不完整的(如您在帖子的幕后看到的那样)。 The most we can say is that the namespace of the root element does not match the target namespace of the XSD . 我们最多可以说的是, 根元素的名称空间与XSD的目标名称空间不匹配 You have a lot more work to do on your end if you want more help on this than that. 如果您需要比这更多的帮助,那么您需要做更多的工作。

Yes, the problem was the targetNamespace of the xsd != namespace of the XML. 是的,问题出在XML的xsd!=名称空间的targetNamespace上。

Thank you 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 cvc-elt.1:找不到元素的声明 - cvc-elt.1: Cannot find the declaration of element org.xml.sax.SAXParseException:cvc-elt.1:找不到元素'tns:root_element'的声明 - org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'tns:root_element' org.xml.sax.SAXParseException; lineNumber:6; columnNumber:122; cvc-elt.1:找不到元素&#39;beans&#39;的声明 - org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 122; cvc-elt.1: Cannot find the declaration of element 'beans' 错误:cvc-elt.1:找不到元素“beans”的声明 - Error: cvc-elt.1: Cannot find the declaration of element 'beans' cvc-elt.1:找不到RootElement的元素声明 - cvc-elt.1: Cannot find the declaration of element for RootElement cvc-elt.1:找不到元素&#39;NewIssue&#39;的声明 - cvc-elt.1: Cannot find the declaration of element 'NewIssue' 使用cvc-elt.1进行xsd验证失败:无法找到元素的声明 - xsd validation fails with cvc-elt.1: Cannot find the declaration of element XML,XSD,cvc-elt.1:找不到元素的声明 - XML, XSD, cvc-elt.1: Cannot find the declaration of element cvc-elt.1:找不到元素“DataModel”的声明 - cvc-elt.1: Cannot find the declaration of element 'DataModel' cvc-elt.1:找不到元素“xs:schema”的声明 - cvc-elt.1: Cannot find the declaration of element 'xs:schema'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM