<?xml version="1.0" encoding="UTF-8"?>
<!--
    Blueprint schema 1.0 (draft 2)

    This file is currently a work in progress.

    ChangeLog
    
    2008-01-03 - edv - Published for Developer Preview
    2008-02-07 - edv - Published for Beta 1
-->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
    targetNamespace="http://mobile.yahoo.com/widgets/schema/1.0/blueprint/"
    xmlns="http://mobile.yahoo.com/widgets/schema/1.0/blueprint/">

    <xs:element name="snippet">
        <xs:annotation>
            <xs:documentation> The snippet element is the top-level element for a snippet. It
                contains a summary and a content section. If a snippet has both summary and content,
                the summary section is shown on the Yahoo! home page, and a 'more' link is
                automatically displayed below it which takes the user to a full-page view of the
                information which is contained in the extended section. The summary element is
                required, while the extended element is not.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" ref="models"/>
                <xs:element name="summary" type="SnippetContentType"/>
                <xs:element minOccurs="0" name="extended" type="SnippetContentType"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="page">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" ref="models"/>
                <xs:element name="content">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" ref="section"/>
                            <xs:element minOccurs="0" maxOccurs="1" ref="goto"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="section">
        <xs:annotation>
            <xs:documentation> A section is a top-level container of a page. There must be at least
                one section in every page. Sections are comprised of modules and controls. The
                header or label of the first section becomes the page's header. The
                section-module-submodule hierarchy is designed to be very strictly nested.
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" ref="header"/>
                <xs:element minOccurs="0" ref="options"/>
                <xs:choice minOccurs="0" maxOccurs="unbounded">
                    <xs:element ref="module"/>
                    <xs:group ref="InnerContent"/>
                </xs:choice>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="options">
        <xs:complexType>
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
                <xs:element ref="option"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="module">
        <xs:annotation>
            <xs:documentation> A module is a basic building block of a widget or snippet. It is used
                to group like pieces of data into one container. It also typically has a header,
                which can be expressed as either a simple label, or a header, which allows you to do
                more expressive layout. The section-module-submodule hierarchy is designed to be
                very strictly nested. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" ref="header"/>
                <xs:choice minOccurs="0" maxOccurs="unbounded">
                    <xs:element ref="submodule"/>
                    <xs:group ref="InnerContent"/>
                </xs:choice>
            </xs:sequence>
            <xs:attribute name="model" type="xs:IDREF"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="submodule">
        <xs:annotation>
            <xs:documentation> A submodule is just like a module, only it cannot contain other
                modules or submodules. The section-module-submodule hierarchy is designed to be very
                strictly nested. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" ref="header"/>
                <xs:group ref="InnerContent"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="header">
        <xs:annotation>
            <xs:documentation> Headers are used for sections, modules, and
            submodules.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="layout-items"/>
                <xs:group ref="Actions"/>
            </xs:sequence>
            <xs:attribute name="layout" default="simple">
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="card">
                            <xs:annotation>
                                <xs:documentation> The card layout allows 0..2 images and 1..n
                                    blocks. It lays out the first image to the left and any second
                                    image to the right. The blocks are laid out top-to-bottom in the
                                    center. </xs:documentation>
                            </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="simple">
                            <xs:annotation>
                                <xs:documentation> The simple layout allows an optional image and 1
                                    block. It lays out the image on the left and the block
                                    immediately to its right. You should use a 'small' image for
                                    this type of layout.</xs:documentation>
                            </xs:annotation>
                        </xs:enumeration>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="goto">
        <xs:annotation>
            <xs:documentation> The goto element is used to add items to the Options menu (in Yahoo!
                Go). Under XHTML, the goto items are displayed in a section at the bottom of the
                page as a series of links. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence maxOccurs="unbounded">
                <xs:element ref="option"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <!-- ============= MODEL ELEMENTS  ================= -->

    <xs:element name="models">
        <xs:complexType>
            <xs:sequence maxOccurs="unbounded">
                <xs:element ref="model"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="model">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="instance"/>
                <xs:element ref="submission"/>
            </xs:sequence>
            <xs:attributeGroup ref="CommonAttrs"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="instance">
        <xs:complexType>
            <xs:sequence>
                <xs:any namespace="##any" processContents="skip" minOccurs="0"/>
            </xs:sequence>
            <xs:attributeGroup ref="CommonAttrs"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="submission">
        <xs:complexType>
            <xs:attribute name="resource" type="xs:anyURI" use="required"/>
            <xs:attribute name="method" default="urlencoded-post">
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="get"/>
                        <xs:enumeration value="urlencoded-post"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attributeGroup ref="CommonAttrs"/>
        </xs:complexType>
    </xs:element>

    <!-- ============= LABEL ELEMENT  ================= -->

    <xs:element name="label">
        <xs:annotation>
            <xs:documentation> The label element is used by many of the controls as their label. For
                example, it serves as the title of a trigger (button), or as the name of an item in
                a select or select1 control. </xs:documentation>
        </xs:annotation>
        <xs:complexType mixed="true">
            <xs:sequence>
                <xs:choice minOccurs="0" maxOccurs="unbounded">
                    <xs:group ref="InlineElements"/>
                </xs:choice>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <!-- ============= OPTION ELEMENT  ================= -->

    <xs:element name="option" type="MenuItemType">
        <xs:annotation>
            <xs:documentation> The option element is used to build a contextual options menu that
                can be accessed by the user either by the left-soft key on Yahoo! Go, or as a series
                of links in XHTML. For example, you might have options that related to an email you
                are currently viewing for commands such as 'reply' or even 'compose'. You can put
                option elements in many different places, and the most appropriate options will be
                displayed in the menu. For example, in an email application 'compose' might be in
                the top-level of a section element, whereas 'reply' or 'delete' might be an option
                inside a placard. When the placard is selected, the options inside of the item are
                added to the options menu. This makes it behave like a contextual menu in Mac OS or
                Windows. The option element is also used by the goto menu.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="MenuItemType">
        <xs:sequence>
            <xs:element ref="label"/>
            <xs:element minOccurs="0" ref="image"/>
            <xs:group ref="Actions"/>
        </xs:sequence>
    </xs:complexType>

    <!-- ============= BLOCK ELEMENT  ================= -->

    <xs:element name="block">
        <xs:annotation>
            <xs:documentation> The block element is much like the paragraph element of HTML. It is a
                container for inline content. </xs:documentation>
        </xs:annotation>
        <xs:complexType mixed="true">
            <xs:group ref="InlineElements"/>
            <xs:attribute name="lines" type="xs:positiveInteger"/>
            <xs:attribute name="class" type="xs:NMTOKENS"/>
        </xs:complexType>
    </xs:element>

    <!-- ============= CONTAINERS =================== -->

    <xs:group name="InnerContent">
        <xs:annotation>
            <xs:documentation> InnerContent represents those things that can live in any container
                (basically, controls). </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:group ref="Controls"/>
                <xs:element ref="block"/>
            </xs:choice>
        </xs:sequence>
    </xs:group>

    <!-- ============= CONTROLS  ================= -->

    <xs:group name="Controls">
        <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element ref="hr"/>
                <xs:element ref="input"/>
                <xs:element ref="image-list"/>
                <xs:element ref="navigation-bar"/>
                <xs:element ref="placard"/>
                <xs:element ref="secret"/>
                <xs:element ref="select"/>
                <xs:element ref="select1"/>
                <xs:element ref="submit"/>
                <xs:element ref="textarea"/>
                <xs:element ref="trigger"/>
            </xs:choice>
        </xs:sequence>
    </xs:group>

    <xs:element name="hr">
        <xs:annotation>
            <xs:documentation> The hr element displays a horizontal rule. There are several classes
                you can use with it: "solid", "dotted", and "none". "none" just displays a blank
                line. You can use that for a small spacer if desired. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="class" type="xs:NMTOKENS"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="item">
        <xs:annotation>
            <xs:documentation> The item element is used in select and select1 controls.
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="value" type="xs:string"/>
                <xs:group ref="CommonControlElements"/>
                <xs:group ref="Actions"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="input">
        <xs:annotation>
            <xs:documentation> The input element is a simple one-line text input box.
            </xs:documentation>
        </xs:annotation>
        <xs:complexType mixed="true">
            <xs:sequence>
                <xs:group ref="CommonControlElements"/>
            </xs:sequence>
            <xs:attributeGroup ref="SingleNodeBinding"/>
            <xs:attributeGroup ref="CommonAttrs"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="image-list">
        <xs:annotation>
            <xs:documentation> The image-list type is a generic control which shows a given list of
                images, each of which can have an action associated with it when clicked. It
                currently tries to show one row of as many images the current device's screen width
                can accomodate. There is no guarantee that each image you include will be rendered
                on screen. It is typically used as a preview of a photostream, etc. You can specify
                a link to jump to for a 'more' link. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" ref="image-trigger"/>
                <xs:element name="more" type="NavLink"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="image-trigger">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="image"/>
                <xs:group ref="Actions"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="navigation-bar">
        <xs:annotation>
            <xs:documentation> The navigation-bar element is used primarily as a paging control. In
                its simplest form, it could be used as a more button. If you want to use it to
                navigate between multiple pages, you can specify both the next and prev elements. If
                you desire some sort of 'back' link, you can supply the back element. If you supply
                an element, but do not supply any actions, the element will be displayed inactive
                (grayed out). You can use this technique if you are at the first or last page, for
                example. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" name="back" type="NavLink"/>
                <xs:element minOccurs="0" name="prev" type="NavLink"/>
                <xs:element name="next" type="NavLink"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:complexType name="NavLink">
        <xs:sequence>
            <xs:element ref="label"/>
            <xs:group ref="Actions"/>
        </xs:sequence>
    </xs:complexType>

    <xs:element name="placard">
        <xs:annotation>
            <xs:documentation> The placard element is probably the most commonly used element. It
                allows you to specify text and icons in various different pre-defined layouts. It
                supports a class of "link" which will give the placard a right-pointing arrow over
                on the right.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="layout-items"/>
                <xs:element minOccurs="0" ref="option"/>
                <xs:element minOccurs="0" ref="help"/>
                <xs:element minOccurs="0" ref="hint"/>
                <xs:group ref="Actions"/>
            </xs:sequence>
            <xs:attributeGroup ref="CommonAttrs"/>
            <xs:attribute name="layout" default="card">
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <!-- up to two images and multiple blocks, in three columns -->
                        <xs:enumeration value="card"/>
                        <!-- one image and multiple blocks, vertically stacked -->
                        <xs:enumeration value="poster"/>
                        <!-- just one optional image and one block -->
                        <xs:enumeration value="simple"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="layout-items">
        <xs:complexType>
            <xs:annotation>
                <xs:documentation> The layout-items type is used as a container of those items
                    needed for a layout for a placard or a header. It allows any number of image or
                    block elements. The interpretation of those elements is up to the layout type of
                    the placard. </xs:documentation>
            </xs:annotation>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="image"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="block"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="rating">
        <xs:annotation>
            <xs:documentation> The rating element allows you to specify a rating and an optional
                number of reviews that the rating is an average of. Currently it uses a fixed 5-star
                rating scale. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" name="stars">
                    <xs:simpleType>
                        <xs:restriction base="xs:integer">
                            <xs:minInclusive value="0"/>
                            <xs:maxInclusive value="5"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
                <xs:element minOccurs="0" name="reviews" type="xs:nonNegativeInteger"/>
            </xs:sequence>
            <xs:attribute name="appearance">
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="full"/>
                        <xs:enumeration value="compact"/>
                        <xs:enumeration value="minimal"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="secret">
        <xs:annotation>
            <xs:documentation> The secret element is a simple one-line edit field that obscures the
                user's input. It is used for passwords. </xs:documentation>
        </xs:annotation>
        <xs:complexType mixed="true">
            <xs:sequence>
                <xs:group ref="CommonControlElements"/>
            </xs:sequence>
            <xs:attributeGroup ref="SingleNodeBinding"/>
            <xs:attributeGroup ref="CommonAttrs"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="select">
        <xs:annotation>
            <xs:documentation> The select element allows the user to select one or more items from
                the list of items presented. Currently, the only presentation type supported for
                this element is 'checkboxes'. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" ref="label"/>
                <xs:element minOccurs="1" maxOccurs="unbounded" ref="item"/>
                <xs:element minOccurs="0" maxOccurs="1" ref="help"/>
                <xs:element minOccurs="0" maxOccurs="1" ref="hint"/>
            </xs:sequence>
            <xs:attribute name="appearance" default="checkboxes">
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="checkboxes"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attributeGroup ref="SingleNodeBinding"/>
            <xs:attributeGroup ref="CommonAttrs"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="select1">
        <xs:annotation>
            <xs:documentation> The select1 element allows the user to select only one item from the
                list of items presented. Currently, the presentation types supported for this
                element are 'popop' and 'radio-group'. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" ref="label"/>
                <xs:element minOccurs="1" maxOccurs="unbounded" ref="item"/>
                <xs:element minOccurs="0" maxOccurs="1" ref="help"/>
                <xs:element minOccurs="0" maxOccurs="1" ref="hint"/>
            </xs:sequence>
            <xs:attribute name="appearance" default="popup">
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="popup"/>
                        <xs:enumeration value="radio-group"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attributeGroup ref="SingleNodeBinding"/>
            <xs:attributeGroup ref="CommonAttrs"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="submit">
        <xs:annotation>
            <xs:documentation> The submit element is much like a trigger and is generally displayed
                as a simple button. It's purpose is to submit the current form data as specified by
                the submission element. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:group ref="CommonControlElements"/>
            <xs:attributeGroup ref="CommonAttrs"/>
            <xs:attribute name="model" type="xs:IDREF"/>
            <xs:attribute name="appearance">
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="full"/>
                        <xs:enumeration value="button"/>
                        <xs:enumeration value="minimal"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="textarea">
        <xs:annotation>
            <xs:documentation> The textarea element is a multi-line input area. </xs:documentation>
        </xs:annotation>
        <xs:complexType mixed="true">
            <xs:group ref="CommonControlElements"/>
            <xs:attributeGroup ref="CommonAttrs"/>
            <xs:attributeGroup ref="SingleNodeBinding"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="trigger">
        <xs:annotation>
            <xs:documentation> The trigger element is essentially a button. It can also be
                represented as just a piece of text by using the 'minimal' appearance.
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:group ref="CommonControlElements"/>
                <xs:group ref="Actions"/>
            </xs:sequence>
            <xs:attributeGroup ref="CommonAttrs"/>
            <xs:attribute name="appearance">
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="full"/>
                        <xs:enumeration value="button"/>
                        <xs:enumeration value="minimal"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:group name="CommonControlElements">
        <xs:sequence>
            <xs:element minOccurs="0" ref="label"/>
            <xs:element minOccurs="0" ref="help"/>
            <xs:element minOccurs="0" ref="hint"/>
        </xs:sequence>
    </xs:group>

    <xs:element name="help" type="xs:string"/>
    <xs:element name="hint" type="xs:string"/>

    <!-- ============= ACTION ELEMENTS  ================= -->

    <xs:element name="actions">
        <xs:complexType>
            <xs:group ref="Actions"/>
        </xs:complexType>
    </xs:element>

    <xs:group name="Actions">
        <xs:sequence>
            <xs:choice>
                <xs:choice minOccurs="0" maxOccurs="unbounded">
                    <xs:element ref="load"/>
                    <xs:element ref="load-page"/>
                    <xs:element ref="send"/>
                </xs:choice>
                <xs:element ref="actions"/>
            </xs:choice>
        </xs:sequence>
    </xs:group>

    <xs:element name="load">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" name="loading-text" type="xs:string"/>
            </xs:sequence>
            <xs:attribute name="event" type="EventID"/>
            <xs:attribute name="resource" type="xs:anyURI"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="load-page">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" name="loading-text" type="xs:string"/>
            </xs:sequence>
            <xs:attribute name="event" type="EventID"/>
            <xs:attribute name="page" type="xs:anyURI"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="send">
        <xs:complexType>
            <xs:attribute name="event" type="EventID"/>
        </xs:complexType>
    </xs:element>

    <!-- ============= INLINE ELEMENTS  ================= -->

    <xs:group name="InlineElements">
        <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element ref="image"/>
                <xs:element ref="strong"/>
                <xs:element ref="em"/>
                <xs:element ref="rating"/>
                <xs:element ref="span"/>
                <xs:element name="br">
                    <xs:complexType/>
                    <!-- empty -->
                </xs:element>
            </xs:choice>
        </xs:sequence>
    </xs:group>

    <xs:element name="strong" type="xs:string"/>
    <xs:element name="em" type="xs:string"/>
    <xs:element name="span">
        <xs:complexType mixed="true">
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
                <xs:choice>
                    <xs:element ref="em"/>
                    <xs:element ref="strong"/>
                </xs:choice>
            </xs:sequence>
            <xs:attribute name="class" type="xs:NMTOKENS"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="image" type="ImageType"/>

    <xs:complexType name="ImageType">
        <xs:attribute name="size" type="ImageSizeType">
            <xs:annotation>
                <xs:documentation>The size attribute is used to specify the size of the image canvas
                    your image will be drawn into. In general the image resource you specify should
                    be at the size that is appropriate for the current screen at the current size.
                    The image cannot be drawn outside the canvas bounds.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="fill-style" type="ImageFillStyleType">
            <xs:annotation>
                <xs:documentation> The fill-style attribute tells the engine how to fit images that
                    are not the same size as the canvas size you are using as specified by 'size'.
                    There are three options: crop (the default), fit, and fill. Crop just centers
                    the image onto the canvas and crops it. Fit scales the image so that the entire
                    image fits into the canvas. Fill scales the image so that the entire canvas is
                    filled by the image. Any part of the image that might extend past the canvas
                    after stretching is cropped. See the reference manual for examples of each.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="resource" type="xs:anyURI">
            <xs:annotation>
                <xs:documentation>The resource attribute specifies the URI of the image. Relative
                    URIs are considered relative to a widget's submission package. For example,
                    "warp.jpg" would reference a file of the same name inside your widget's
                    resources/images/&lt;screensixe&gt; directory.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="caption" type="xs:string"/>
    </xs:complexType>

    <!-- ============= CUSTOM TYPES  ================= -->

    <xs:complexType name="SnippetContentType">
        <xs:sequence>
            <xs:group ref="InnerContent"/>
        </xs:sequence>
    </xs:complexType>

    <xs:simpleType name="EventID">
        <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="activate"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ImageSizeType">
        <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="small"/>
            <xs:enumeration value="small-full"/>
            <xs:enumeration value="medium"/>
            <xs:enumeration value="medium-full"/>
            <xs:enumeration value="large"/>
            <xs:enumeration value="large-full"/>
            <xs:enumeration value="x-large"/>
            <xs:enumeration value="x-large-full"/>
            <xs:enumeration value="banner"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ImageFillStyleType">
        <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="crop"/>
            <xs:enumeration value="fit"/>
            <xs:enumeration value="fill"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ImageAspectType">
        <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="square"/>
            <xs:enumeration value="full"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="InlineContainer">
        <xs:group ref="InlineElements"/>
    </xs:complexType>

    <!-- ============== BINDING ==================== -->

    <xs:attributeGroup name="SingleNodeBinding">
        <xs:attribute name="ref" type="xs:NMTOKEN"/>
        <xs:attribute name="model" type="xs:IDREF"/>
    </xs:attributeGroup>

    <!-- ============== COMMON ATTRS ==================== -->

    <xs:attributeGroup name="CommonAttrs">
        <xs:attribute name="id" type="xs:ID"/>
        <xs:attribute name="class" type="xs:NMTOKENS"/>
    </xs:attributeGroup>
</xs:schema>
