<?xml version="1.0" encoding="UTF-8"?>
<!--
    Blueprint schema 1.0

    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
    2008-06-23 - edv - Published for 1.0 FINAL
-->

<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 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 ref="page-header" minOccurs="0"/>
                <xs:element ref="content"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="page-header">
        <xs:complexType>
            <xs:sequence>
                <xs:choice minOccurs="0" maxOccurs="1">
                    <xs:element name="masthead" type="PlacardLayoutObject"/>
                </xs:choice>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="content">
        <xs:complexType>
            <xs:sequence>
                <xs:group ref="ModuleContents" maxOccurs="unbounded"/>
                <xs:element ref="options" minOccurs="0"/>
                <xs:element ref="goto" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:complexType name="PlacardLayoutObject">
        <xs:annotation>
            <xs:documentation> The PlacardlayoutObject is a base type for placard and any other
                placard-like objects. It merely is that core part that describes the placard-like
                layouts. It does *not* support the 'link' class. That is reserved for placards. All
                this drives is the layout. </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="layout-items"/>
        </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 name="options">
        <xs:complexType>
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
                <xs:element ref="option"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:group name="ModuleContents">
        <xs:sequence>
            <xs:choice>
                <xs:element ref="module"/>
                <xs:group ref="InnerContent"/>
            </xs:choice>
        </xs:sequence>
    </xs:group>

    <xs:element name="module">
        <xs:annotation>
            <xs:documentation> A module is a basic building block of a widget. It is used to group
                like pieces of data into one container. It also typically has a header.
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="header" minOccurs="0"/>
                <xs:group ref="ModuleContents" minOccurs="0" maxOccurs="unbounded"/>
            </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: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..5
                                    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 minOccurs="0" ref="instance"/>
                <xs:element minOccurs="0" 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="secure" type="xs:boolean" default="false"/>
            <xs:attribute name="method" default="urlencoded-post">
                <xs:annotation>
                    <xs:documentation> The method attribute is used to control how data is sent to
                        the resource identified by the resource attribute. Each of the different
                        methods has a serialization method associated with it. The get and
                        urlencoded-post methods use application/x-www-form-urlencoded. The post
                        method sends the data as application/xml. </xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="get"/>
                        <xs:enumeration value="post"/>
                        <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="input"/>
                <xs:element ref="image-list"/>
                <xs:element ref="location-chooser"/>
                <xs:element ref="map"/>
                <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="table"/>
                <xs:element ref="textarea"/>
                <xs:element ref="trigger"/>
            </xs:choice>
        </xs:sequence>
    </xs:group>

    <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 minOccurs="0" ref="label"/>
                <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:element minOccurs="0" ref="label"/>
                <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="location-chooser">
        <xs:annotation>
            <xs:documentation> The location chooser control allows the user to choose a location
                which is returned to your widget. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="label" minOccurs="0"/>
                <xs:group ref="CommonControlElements"/>
            </xs:sequence>
            <xs:attributeGroup ref="SingleNodeBinding"/>
            <xs:attributeGroup ref="CommonAttrs"/>
            <xs:attribute name="set-current" type="xs:boolean" default="false"/>
        </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:complexContent>
                <xs:extension base="PlacardLayoutObject">
                    <xs:sequence>
                        <xs:element minOccurs="0" ref="help"/>
                        <xs:element minOccurs="0" ref="hint"/>
                        <xs:group ref="Actions"/>
                    </xs:sequence>
                    <xs:attributeGroup ref="CommonAttrs"/>
                </xs:extension>
            </xs:complexContent>
        </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. While this element as defined
                    here allows any number of image or block elements, the type of layout might only
                    allow a certain number. Also, the interpretation of those elements is up to the
                    layout type of the placard. See the different layout types in placard and header
                    for specifics. </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:element minOccurs="0" ref="label"/>
                <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 'popup' 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:sequence>
                <xs:element ref="label"/>
                <xs:group ref="CommonControlElements"/>
            </xs:sequence>
            <xs:attributeGroup ref="CommonAttrs"/>
            <xs:attributeGroup ref="SingleNodeBinding"/>
            <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:sequence>
                <xs:element minOccurs="0" ref="label"/>
                <xs:group ref="CommonControlElements"/>
            </xs:sequence>
            <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. In fact, that's the only
                appearance you can use for it at present. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="label"/>
                <xs:group ref="CommonControlElements"/>
                <xs:group ref="Actions"/>
            </xs:sequence>
            <xs:attributeGroup ref="CommonAttrs"/>
            <xs:attribute name="appearance" default="button">
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="button"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:group name="CommonControlElements">
        <xs:sequence>
            <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"/>

    <!-- ============= TABLE CONTROL  ================= -->

    <xs:element name="table">
        <xs:complexType>
            <xs:annotation>
                <xs:documentation> Tables allow display of tabular data. They might be used for data
                    such as sports scores or financial data. The table implementation in Blueprint
                    is somewhat limited, and lays out a bit different that what you might be used to
                    in HTML. First, cells in a table can only contain text at present. Second, the
                    table structure is somewhat fixed in that the 'title' of a row (e.g. the team
                    name for a sports score) is always the leftmost column, and in fact is not
                    counted as a column at all. The columns are only the set of data to display, and
                    each column or row can have a title associated with it. A table also has the
                    notion of bias, which can affect display and layout (see the bias attribute for
                    more). To fit into tight spaces, columns are dropped in a left-to-right order,
                    with the assumption that your most important data is on the right. If you wish
                    for columns to not be dropped, you can mark them required via an attribute. It
                    is imperative you do not mark too many columns required, or else on certain
                    devices your table might not be displayed because the required columns cannot
                    fit. </xs:documentation>
            </xs:annotation>
            <xs:sequence>
                <xs:element ref="columns"/>
                <xs:element ref="rows"/>
            </xs:sequence>
            <xs:attribute name="bias" default="none">
                <xs:annotation>
                    <xs:documentation> Bias controls how a table looks as well as how it is laid
                        out. The idea stems around how data is to be viewed. Some types of data
                        might be best viewed horizontally and some might be best viewed vertically.
                        For those situations, we have 'row' and 'column' bias, respectively. These
                        generally give the rows/columns alternating bands of color to help
                        readability where it can be supported. The bias affects layout by
                        essentially stating that horizontally biased tables can split into two
                        lines, where the title of the row is on one line and the tabular data is on
                        the next. This is shown in the pictures. A bias of 'none' does no visual
                        treatment, however it uses horizontal bias layout rules by default.
                    </xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="row"/>
                        <xs:enumeration value="column"/>
                        <xs:enumeration value="none"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="drop-optional" default="to-fit">
                <xs:annotation>
                    <xs:documentation> The drop-optional attribute tells the table how it should
                        drop optional columns in order to fit on the current device. If set to
                        'to-fit', columns not marked 'required' are dropped in a left-to-right order
                        on devices that can support this. If set to 'all-at-once', all optional
                        columns are dropped and only required columns are rendered.
                    </xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="to-fit"/>
                        <xs:enumeration value="all-at-once"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="columns">
        <xs:annotation>
            <xs:documentation> The columns element holds a non-empty set of columns. There must be
                one column element for each column you wish to display. </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="column" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="column">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="title"/>
            </xs:sequence>
            <xs:attribute name="numeric-emphasis" type="xs:boolean" default="false">
                <xs:annotation>
                    <xs:documentation> The numeric-emphasis attribute is a boolean which tells the
                        table to effectively colorize anything that parses as a number and is
                        preceded with a - or + sign. This is useful when displaying financial data.
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="required" type="xs:boolean" default="false">
                <xs:annotation>
                    <xs:documentation> The required attribute tells the table that this column is
                        required and should not be dropped if there is not enough room to display
                        all columns. Is is imperative that you do not mark too many columns required
                        or else your table will not be displayed if the required columns cannot fit
                        (or it might be displayed in a very broken manner). </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="align" default="default">
                <xs:annotation>
                    <xs:documentation> The align attribute simply controls whether the data in the
                        column should be left, right, or center aligned. The 'default' value means
                        do whatever is appropriate for the current locale (though at present, this
                        equates to left for all locales until Blueprint supports right-to-left).
                    </xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:NMTOKEN">
                        <xs:enumeration value="left"/>
                        <xs:enumeration value="right"/>
                        <xs:enumeration value="center"/>
                        <xs:enumeration value="default"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

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

    <xs:element name="row">
        <xs:annotation>
            <xs:documentation> The row element contains the a required title followed by a cell
                element which contains the data for each column. If there are not enough cells for
                the number of columns, the table will render the remaining columns as empty. If
                there are more cells than the number of columns, the extra cells are dropped.
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="title"/>
                <xs:element ref="cell" maxOccurs="unbounded"/>
                <xs:group ref="Actions"/>
            </xs:sequence>
            <xs:attribute name="emphasized" type="xs:boolean" default="false">
                <xs:annotation>
                    <xs:documentation> The emphasized attribute tells the table that this cell
                        should be displayed in an emphasized manner. Typically, this is rendered as
                        bold. </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="title"/>
    <xs:element name="cell">
        <xs:complexType mixed="true">
            <xs:attribute name="emphasized" type="xs:boolean" default="false">
                <xs:annotation>
                    <xs:documentation> The emphasized attribute tells the table that this cell
                        should be displayed in an emphasized manner. Typically, this is rendered as
                        bold. </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <!-- ============= MAP CONTROL  ================= -->

    <xs:element name="map" type="MapType"/>

    <xs:complexType name="MapType">
        <xs:annotation>
            <xs:documentation> The map element and show-map action can be used to show a particular
                location. It supports the various map modes (hybrid, satellite, etc.) as well as
                zoom levels and traffic. It can also show points of interest.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="center" type="LocationType"/>
            <xs:element ref="map-zoom"/>
            <xs:element ref="map-mode"/>
            <xs:element minOccurs="0" name="map-showtraffic" type="xs:boolean"/>
            <xs:element minOccurs="0" maxOccurs="unbounded" ref="map-point"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="EmptyType"/>

    <xs:element name="location" type="LocationType"/>

    <xs:complexType name="LocationType">
        <xs:all>
            <xs:element name="latitude" type="xs:double"/>
            <xs:element name="longitude" type="xs:double"/>
            <xs:element name="name" minOccurs="0"/>
            <xs:element name="street" minOccurs="0"/>
            <xs:element name="city" minOccurs="0"/>
            <xs:element name="state" minOccurs="0"/>
            <xs:element name="postal-code" minOccurs="0"/>
            <xs:element name="country" minOccurs="0"/>
        </xs:all>
    </xs:complexType>

    <xs:element name="map-mode">
        <xs:simpleType>
            <xs:restriction base="xs:NMTOKEN">
                <xs:enumeration value="map"/>
                <xs:enumeration value="satellite"/>
                <xs:enumeration value="hybrid"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>

    <xs:element name="map-zoom">
        <xs:simpleType>
            <xs:restriction base="xs:positiveInteger">
                <xs:maxInclusive value="18"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>

    <xs:element name="map-point">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="location" type="LocationType"/>
                <xs:element ref="placard"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

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

    <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="show-driving-directions"/>
                    <xs:element ref="show-map"/>
                </xs:choice>
            </xs:choice>
        </xs:sequence>
    </xs:group>

    <xs:attributeGroup name="ActionAttributes">
        <xs:attribute name="event" type="EventID"/>
    </xs:attributeGroup>

    <xs:element name="load">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" name="loading-text" type="xs:string"/>
            </xs:sequence>
            <xs:attributeGroup ref="ActionAttributes"/>
            <xs:attribute name="resource" type="xs:anyURI"/>
            <xs:attribute name="secure" type="xs:boolean" default="false"/>
        </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:attributeGroup ref="ActionAttributes"/>
            <xs:attribute name="page" type="xs:anyURI"/>
            <xs:attribute name="secure" type="xs:boolean" default="false"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="show-map">
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="MapType">
                    <xs:attributeGroup ref="ActionAttributes"/>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="show-driving-directions">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="origin" type="LocationType"/>
                <xs:element name="destination" type="LocationType"/>
            </xs:sequence>
            <xs:attributeGroup ref="ActionAttributes"/>
        </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" default="medium">
            <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/ directory. Technically though, you need only specify the name
                    of the file, e.g. "warp", as for bundled Widgets we will look up the best size
                    to use based on what images are in your images directory. See the Blueprint
                    Developer's Guide for more information on how images should be named in your
                    widget so that the engine can deal with multiple screen sizes.
                </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:annotation>
                    <xs:documentation> The activate event is sent when a control is 'clicked' or, in
                        some cases, when the enter key is pressed. </xs:documentation>
                </xs:annotation>
            </xs:enumeration>
        </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>

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

    <xs:attributeGroup name="SingleNodeBinding">
        <xs:attribute name="ref" type="xs:NMTOKEN" use="optional"/>
        <xs:attribute name="model" type="xs:IDREF" use="optional"/>
    </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>
