这个 xsd 可能有什么问题?
我有一个xsd。当我尝试在 BizTalk 中验证它时,它给出了这些错误:
error BEC2009: Node "<Schema>" - Schema reference "http://www.w3.org/2001/xml.xsd" is not a valid reference or does not exist in the current project.
error BEC2009: Node "<Schema>" - Schema reference "http://www.w3.org/2001/xml.xsd" is not a valid reference or does not exist in the current project.
warning BEC999: Cannot resolve the 'schemaLocation' attribute.
error BEC3001: The 'http://www.w3.org/XML/1998/namespace:space' attribute is not declared.
warning BEC999: Cannot resolve the 'schemaLocation' attribute.
warning BEC1007: Node "<Schema>" - Target namespace is empty.
我认为它指的是如下所示的命名空间:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
不确定这是否是足够的信息来继续...
编辑:
我发现根据我用来验证 xml 的程序有时会起作用。例如。如果我创建一些 .net 代码来根据架构验证 xml,它似乎可以读取 xsd 并验证 xml。如果我在 notepad++ 中使用 xml 验证,它会说它无法读取架构。在另一个映射器(WTX)中,他们说它也不起作用。
我还可以尝试其他方法来缩小可能出现问题的范围吗?
编辑2:
感谢 xcut。发现如果我在本地下载架构并将其放入 BizTalk 项目中,架构验证正常,但有 1 个警告: 警告 BEC1007:节点“” - 目标命名空间为空。
I have an xsd. When I try to validate it in BizTalk it gives these errors:
error BEC2009: Node "<Schema>" - Schema reference "http://www.w3.org/2001/xml.xsd" is not a valid reference or does not exist in the current project.
error BEC2009: Node "<Schema>" - Schema reference "http://www.w3.org/2001/xml.xsd" is not a valid reference or does not exist in the current project.
warning BEC999: Cannot resolve the 'schemaLocation' attribute.
error BEC3001: The 'http://www.w3.org/XML/1998/namespace:space' attribute is not declared.
warning BEC999: Cannot resolve the 'schemaLocation' attribute.
warning BEC1007: Node "<Schema>" - Target namespace is empty.
I think it is referring to the namespaces which look like this:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
Not sure if that is enough information to go on...
Edit:
I found that depending on what program I use to validate xml with it sometimes works. For example. If I create some .net code to validate an xml against the schema it seems to read the xsd ok and validates the xml. If I use the xml validation in notepad++ it says it cannot read the schema though. In another mapper (WTX) they say it also does not work.
Are there other things I can try to narrow down possible issues?
Edit 2:
Thanks to xcut. Found that if I download the schema locally and put it in the BizTalk project the schema validates ok, but with 1 warning:
warning BEC1007: Node "" - Target namespace is empty.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
除了导入命名空间架构有点奇怪之外,BizTalk 可能根本无法通过 URL 导入架构(而您的 .net 代码可以)。
要排除此问题,请从 w3.org 下载架构,将其放入您的项目中并从那里导入,而不是通过 http 导入。
Apart from it being a bit strange to import the namespace schema, it may be that BizTalk simply cannot import a schema through a URL (whereas your .net code can).
To exclude this as an issue, download the schema from w3.org, put it in your project and import it from there instead of over http.