<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:misc="http://www.atsc.org/XMLSchemas/iss-misc-1"
    xmlns:sg="http://www.atsc.org/XMLSchemas/nrt-sg-2"
    targetNamespace="http://www.atsc.org/XMLSchemas/iss-misc-1" elementFormDefault="qualified"
    version="1.0">
    <import namespace="http://www.atsc.org/XMLSchemas/nrt-sg-2" schemaLocation="SG2.0.xsd"/>
    
    <annotation>
        <documentation source="http://www.atsc.org/cms/standards/cs_documents/A105-CS.zip">
            ATSC IIS Miscellaneous schema elements
            Version: 1.0
            Date: 12/12/2013
            Namespace: http://www.atsc.org/XMLSchemas/iss-misc-1           
            Information about the use of this schema can be found in ATSC standard A/105-2013.
            This schema defines three XML elements:
            (1) An XML element named LinkMetadata that is used to 
            provide attributes associated with a Link (URL) to a Declarative
            Object (application) that can be downloaded from a remote server 
            and run on demand. 
            (2) An XML element named AugmentedTrigger that is used to
           convey an activation trigger and associated TPT information from 
            a TV receiver to a second screen device.
            (3) An XML element named Trigger that is used to convey a
            trigger in its raw form from a TV receiver to a second screen
            device.
        </documentation>
    </annotation>
    
    <annotation>
        <documentation xml:lang="en">
            LinkMetadata element, used to provide attributes associated with a Link
        </documentation>
    </annotation>
    <element name="LinkMetadata" type="misc:LinkMetadataType"/>

    <annotation>
        <documentation xml:lang="en">
            AugmentedTrigger  element, used to convey an activation trigger and
            associated TPT information from a TV receiver to a second screen
            device
        </documentation>
    </annotation>
    <element name="AugmentedTrigger" type="misc:AugTriggerType"/>

    <annotation>
        <documentation xml:lang="en">
            Trigger  element, used to convey a trigger in its raw form from a
            TV receiver to a second screen device
        </documentation>
    </annotation>
    <element name="Trigger">
        <complexType>
            <attribute name="channelChange" type="boolean" use="optional"/>
            <attribute name="interactionModel" type="unsignedByte" use="optional"/>
            <attribute name="triggerString" type="string" use="required"/>
        </complexType>
    </element>

    <annotation>
        <documentation xml:lang="en">
            LinkMetadataType, the XML type for a LinkMetadata element
        </documentation>
    </annotation>
    <complexType name="LinkMetadataType">
        <sequence>
            <element name="Icon" minOccurs="0" maxOccurs="unbounded">
                <complexType>
                    <attribute name="source" type="anyURI" use="required"/>
                    <attribute name="width" type="unsignedShort" use="optional"/>
                    <attribute name="height" type="unsignedShort" use="optional"/>
                </complexType>
            </element>
        </sequence>
        <attribute name="url" type="anyURI" use="required"/>
        <attribute name="title" type="string" use="optional"/>
        <attribute name="majChanNum" type="unsignedShort" use="optional"/>
        <attribute name="minChanNum" type="unsignedShort" use="optional"/>
        <attribute name="channelName" type="string" use="optional"/>
        <attribute name="programName" type="string" use="optional"/>
        <attribute name="expiration" type="dateTime" use="optional"/>
    </complexType>

    <annotation>
        <documentation xml:lang="en">
           AugTriggerType, the XML type  for an AugmentedTrigger element
        </documentation>
    </annotation>
    <complexType name="AugTriggerType">
        <sequence>
            <element name="Capabilities" type="sg:CapabilitiesType" minOccurs="0"/>
            <element name="Event">
                <complexType>
                    <attribute name="action" type="unsignedByte" use="required"/>
                    <attribute name="destination" type="unsignedByte" use="optional"/>
                    <attribute name="diffusion" type="unsignedByte" use="optional"/>
                    <attribute name="data" type="base64Binary" use="optional"/>
                </complexType>
            </element>
        </sequence>
        <attribute name="interactionModel" type="unsignedByte" use="required"/>
        <attribute name="appURL" type="anyURI" use="required"/>
        <attribute name="cookieSpace" type="unsignedByte" use="optional"/>
    </complexType>

</schema>
