找不到元素-SOAP的声明
文档文档=空; DocumentBuilder解析器 = DocumentBuilderFactory.newInstance().newDocumentBuilder(); 文档 = parser.paser(xmlFilePath);
解析异常 萨克斯异常 IOException
无异常返回文档。
使用 xmllist“schema” xml 验证的
SchemaFactory schema = SchemaFactory.newInstance(XMLConstanst.W3C_XML_SCHEMA_NS_URI);
架构 schema = schemaFactory.newSchema(new Source []{new StreamSource(xsd1), new StreamSource(xsd2), new StreamSource(xsd3), newStreamSource(xsd4)})
验证器 validator = schema.newValidator(); validator.setErrorHandler(new CustomHandler);
validator.validate(new DOMSource(document);
SAXParseException cvc-elt.1 找不到元素“ElementinQuestion”的声明
String node = document.getNodeName();
node = #document
添加以下内容时,节点返回与上面相同的异常
String 节点 = document.getFirstChildNode().getNodeName();
节点 = "ElementinQuestion"
xsd
我还能检查什么?
Document document = null;
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
document = parser.paser(xmlFilePath);
ParseException
SaxException
IOException
returned document without exception.
Using xmllist "schema" xml validated
SchemaFactory schema = SchemaFactory.newInstance(XMLConstanst.W3C_XML_SCHEMA_NS_URI);
Schema schema = schemaFactory.newSchema(new Source []{new StreamSource(xsd1), new StreamSource(xsd2), new StreamSource(xsd3), newStreamSource(xsd4)})
Validator validator = schema.newValidator();
validator.setErrorHandler(new CustomHandler);
validator.validate(new DOMSource(document);
SAXParseException cvc-elt.1 Cannot find the declaration of element "ElementinQuestion"
String node = document.getNodeName();
node = #document
When the following is added the node returns the same exception above
String node = document.getFirstChildNode().getNodeName();
node = "ElementinQuestion"
xsd
<s: element name = "ElementinQuestion" type = elementinquestion:ElementinQuestion"
What else can I check?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加了这一行,并在创建文档之前解决了异常
(发现这个向下滚动到底部
Cvc-elt.1:找不到元素的声明'肥皂:信封')
Added this line and the exception was resolved prior to creating the document
(Found this scrolling down to the bottom
Cvc-elt.1: Cannot Find The Declaration Of Element 'soap:Envelope')