[RESOLVED] Odd Error

admin

Administrator
Staff member
I'm getting an error @ the orange part of the code. I am guessing this is a namespace issue but I simply don't know what the solution is.

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="dinosaurs" targetNamespace="http://www.straystudios.com/dinosaurs" elementFormDefault="qualified" xmlns="http://www.straystudios.com/dinosaurs" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="dinosaurs">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="carnivore">
<xs:complexType>
<xs:group ref="DinosaurGroup" />
</xs:complexType>
</xs:element>
<xs:element name="herbivore">
<xs:complexType>
<xs:group ref="DinosaurGroup" />
</xs:complexType>
</xs:element>
<xs:element name="omnivore">
<xs:complexType>
<xs:group ref="DinosaurGroup" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:group name="DinosaurGroup">
<xs:sequence>
<xs:element name="species" type="xs:string" />
<xs:element name="length" type="xs:string" />
<xs:element name="height" type="xs:string" />
<xs:element name="weight" type="xs:string" />
<xs:element name="speed" type="xs:string" />
<xs:element name="weapon" type="WeaponType" />
<xs:element name="discoverer" type="DiscovererType" />
<xs:element name="location" type="LocationType" />
<xs:element name="description" type="DescriptionType" />
</xs:sequence>
</xs:group>
<xs:complexType name="WeaponType">
<xs:sequence minOccurs="0">
<xs:element name="part-of-body" type="string" />
<xs:element name="description" type="DescriptionType" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="DiscovererType">
<xs:sequence>
<xs:element name="name" type="string" maxOccurs="unbounded" />
<xs:element name="year" type="string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="LocationType">
<xs:choice>
<xs:element name="GPS" type="string" />
<xs:sequence>
<xs:element name="country" type="string" />
<xs:element name="region" type="string" />
</xs:sequence>
</xs:choice>
</xs:complexType>
<xs:complexType name="DescriptionType" mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="b" type="string" />
<xs:element name="i" type="string" />
</xs:choice>
</xs:complexType>
</xs:schema>

The error I get is "http://www.straystudios.com/dinosaurs:string is not declared."

When I get rid of the type="string" the error moves to the <i> element and when I get rid of it there it moves onto the <country> element and so on.
 
Top