PDA

View Full Version : Help me understand xsd


dreamingdigital
07-20-2007, 07:33 PM
I can't figure out how to understand this:

<xs:element name="alternate_image">
<xs:annotation>
<xs:documentation>Additional product images, such as swatches, larger images or style variants.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="image"/>
<xs:element name="alt_image_link_text">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>


It's the code to add alternate images. I thought I'd need to do it like this: (but it doesn't validate)

<alternate_image>
<image>http://www.somewhere.com/images/me.jpg</image>
</alternate_image>


but it fails with error: "The element 'product_container' has invalid child element 'alternate_image'. List of possible elements expected: 'keywords'."

Please help me understand. What the XSD is telling me to code.