在Visual Studio IDE中使用XSD进行XML验证 - XML Validation with XSD in Visual Studio IDE

问题:

I know I have done this before, but it isn't working today, nor can I find anywhere that explains how to do it. 我知道我以前做过这个,但今天不行,也找不到解释怎么做的地方。 It could be my lack of sleep, but I suspect gremlins. 这可能是我的睡眠不足,但我怀疑是小鬼。

I have an XML document and a directory full of XSD's that define it. 我有一个XML文档和一个充满XSD的目录来定义它。 How do I set the Visual IDE up to notify me of validation failures, and then provide an intellisense list of valid tags and attributes in a given context? 如何设置Visual IDE以通知我验证失败,然后在给定的上下文中提供有效标签和属性的智能感知列表?

What I have tried: 我尝试过的:

  • I've added the XSD's to the project with the XML document. 我已经使用XML文档将XSD添加到项目中。
  • I've added the XSD's to the XML Schema list (under XML / Schemas... menu item.) 我已将XSD添加到XML Schema列表中(在XML / Schemas ...菜单项下)。
  • I've even included the schemaLocation and noNamespaceSchemaLocation attributes to the XML document. 我甚至将schemaLocation和noNamespaceSchemaLocation属性包含在XML文档中。

Visual Studio still isn't giving up any useful debugging or editing information. Visual Studio仍然没有放弃任何有用的调试或编辑信息。 I tried both 2010 and 2008 (I've done it before in 2008 I thought) 我试过了2010年和2008年(我在2008年之前就已经做过了)

Update: I had another developer try this and it failed for him too. 更新:我有另一个开发人员尝试这个,它也失败了。 He knows he has done it with other XML documents and had it work. 他知道他已经使用其他XML文档完成了它并使其工作。 I then downloaded Oxygen XML editor and it worked fine on the same XML and XSD files, so the files seem to be fine (or Oxygen is more forgiving / flexible . . . ) 然后我下载了Oxygen XML编辑器,它在相同的XML和XSD文件上运行良好,所以文件看起来很好(或者Oxygen更宽容/更灵活......)


解决方案:

参考: https://stackoom.com/en/question/DGNU
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章