visual-studio 如何使用 Visual Studio 2005 根据架构验证 XML 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52326/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 16:28:12  来源:igfitidea点击:

How to validate an XML file against a schema using Visual Studio 2005

xmlvisual-studioxsltvisual-studio-2005

提问by Edward Wilde

Is it possible to validate an xml file against its associated schema using Visual Studio 2005 IDE?

是否可以使用 Visual Studio 2005 IDE 根据其关联架构验证 xml 文件?

I could only see options to create a schema based on the current file, or show the XSLT output

我只能看到基于当前文件创建架构的选项,或显示 XSLT 输出

alt text

替代文字

回答by Edward Wilde

It's done automatically, errors appear as warnings in the "Error List" and are additionally underlined with the blue squiggle in the source file.

它是自动完成的,错误在“错误列表”中显示为警告,并在源文件中用蓝色波浪线加下划线。

Not sure if there is another way to validate the file, but this will do for now.

不确定是否有另一种方法来验证文件,但现在可以这样做。

回答by Dan Blair

XmlSchemaValidator

XmlSchema验证器

Warning: It's not pretty to use.

警告:使用起来并不美观。