Justin N

Justin N

  • NA
  • 19
  • 0

"Type [namespace:type] is not declared"

Apr 24 2014 11:56 AM
Im using Visual Studio 2013 to develop an XSD Schema that imports another schema for use of its "Neck" type.  For some reason Visual Studio doesnt like my use of type="wn:Neck", resulting in the error mentioned in the title.  Below is my parent schema and after that is the child schema. Visually the schema looks correct but VS2013 disagrees. Does anyone know why this is happening? Ive seen similar questions but haven't found a direct solution to this issue.

Parent

    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
               xmlns:xs="http://www.w3.org/2001/XMLSchema"
               xmlns:wn="http://fxb.co/xsd/warmoth/neck.xsd"           
               targetNamespace="http://fxb.co/xsd/warmoth/customitem.xsd">
      <xs:import namespace="http://fxb.co/xsd/warmoth/neck.xsd" schemaLocation="./Neck.xsd"/>
      <xs:element name="CustomItems">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="CustomItemOption">
              <xs:complexType>
                <xs:sequence>                  
                  <xs:element minOccurs="0" maxOccurs="unbounded" name="Neck" type="wn:Neck" />            
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

Child

    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"            
               xmlns:xs="http://www.w3.org/2001/XMLSchema"
               xmlns:wn="http://fxb.co/xsd/warmoth/neck.xsd"
               targetNamespace="http://fxb.co/xsd/warmoth/neck.xsd" >
      <xs:element id="Neck" name="Neck">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Headstock">
              <xs:complexType>
                <xs:attribute name="active" type="xs:boolean" default="true" />
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

Answers (1)