7

I'm making use of a custom dictionary (CustomDictionary.xml) for Code Analysis, and it is working like it should. But, I keep getting warnings that indicate to me that the XML file is not defining its XSD schema location properly:

CustomDictionary.xml warnings

I found the XSD (CustomDictionary.xsd) on my machine, and I specified the scheme of its URI as type file:

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

With this URI, Chrome is able to locate the XSD file just fine. That said, how do I properly reference CustomDictionary.xsd from within CustomDictionary.xml?

What I have found so far indicates that the following should work, but it is not:

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

(Note that I have truncated the path to CustomDictionary.xsd for clarity.)

Any suggestions on what I'm doing wrong?

DavidRR
  • 18,291
  • 25
  • 109
  • 191
Eric
  • 2,207
  • 2
  • 16
  • 16

1 Answers1

8

Add CustomDictionary.xsd into your project. And in your XML file, CustomDictionary.xml, add the xmlns:xsi and xsi:noNamespaceSchemaLocation attributes to the Dictionary element as follows:

<Dictionary xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="CustomDictionary.xsd">
DavidRR
  • 18,291
  • 25
  • 109
  • 191
cilerler
  • 9,010
  • 10
  • 56
  • 91