2014-10-29 74 views
5

我正在使用自定義字典(CustomDictionary.xml)進行代碼分析,並且它的工作方式應該如此,但我不斷收到警告,告訴我該xml文件未正確定義其xsd模式位置。在Visual Studio(2013)中定義CustomDictionary模式的正確方法是什麼?

CustomDictionary.xml warnings

我發現我的機器上的XSD和uri'd它作爲一個文件鏈接:

file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%2012.0/Team%20Tools/Static%20Analysis%20Tools/Schemas/CustomDictionary.xsd 

此鏈接在Chrome中打開的.xsd就好了。

如何正確引用它,然後在CustomDictionary.xml中?

什麼我迄今發現表明以下,但它是不正確的:

<Dictionary 
    xmlns="http://www.w3schools.com" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.w3.org/ file:/.../CustomDictionary.xsd"> 

(我已經截斷了清晰的文件路徑)對我在做什麼

任何建議錯誤?

由於提前, --Eric

回答

5

添加CustomDictionary.xsd到您的項目,並在你的XML文件,更改爲行字典元素的屬性如下

<Dictionary xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="CustomDictionary.xsd"> 
相關問題