> Visual Studio 2010中是否通过Intellisense提供XSD密钥/ keyref验证支持?
>如果是这样,如何使它工作?
>如果不是,Visual Studio中是否有(内置)方法在具有XSD架构的XML中进行密钥/引用验证?
谢谢!
更新:请注意,问题不在于如何验证具有XSD文件的XML.我特别询问了关键/ keyref intellisense / Visual Studio中的任何支持,它似乎根本没有添加.
但是,当架构文档错误地使用key / keyref时,Visual Studio不会为架构文档本身提供任何错误 – 与某些文档是否符合架构无关.
具体来说,模式中定义的key / keyref元素必须在选择器xpath语句中使用名称空间,根据以下SO帖子:
https://stackoverflow.com/a/4492004/344638
报价:
Furthermore – this is a gotcha – key constraints don’t recognise the default namespace. You must always prefix every part of the selector xpath with the namespace prefix of the element you’re looking up. If you don’t have a namespace prefix – tough,you’ll need to add one. This is a limitation of the standard.
以下SO帖子提供了使用key / keyref,XML文档实例和基于C#的手动验证程序的模式的完整示例.架构和XML文档实例在Visual Studio中正确验证 – 如果文档违反架构的key / keyref约束,Visual Studio将生成错误:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。