<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" 
    xmlns:fd="http://www.atsc.org/XMLSchemas/nrt-fdt-2" 
    targetNamespace="http://www.atsc.org/XMLSchemas/nrt-fdt-2" 
    elementFormDefault="qualified" version="2.0">
	<annotation>
		<documentation source="http://www.atsc.org/cms/standards/TBD">
            ATSC NRT - File Delivery schema definitions
            Version: 2.0
            Date: TBD 
            Location: TBD
            Namespace: http://www.atsc.org/XMLSchemas/nrt-fd-2

            Information about the use of this schema can be found in ATSC standard
                A/103 Non-Real-Time Content Delivery
            available at http://www.atsc.org/ and referenced as [NRT] below.

            This schema defines XML elements used as extensions to the schema
                defined for the FLUTE FDT in IETF RFC 6726.
                These extensions add ATSC NRT-specific metadata to express
                grouping of files into content items within the FLUTE sessions
                used for content delivery in ATSC NRT services (fixed or mobile).
            FDT Instances are expected to consist of XML elements
                from the IETF FLUTE File Description Table
                namespace (urn:ietf:params:xml:ns:fdt), as defined in
                the schema located (at the time of publication) at
                      http://www.iana.org/assignments/xml-registry/schema/fdt.xsd
                with ATSC NRT extension elements inserted in a manner consistent
                with the wildcards in that schema.
            This schema also defines a MultiFileRequest element that is used to
                retrieve initial versions and subsequent updates of files that are being 
                frequently updated. 
        </documentation>
	</annotation>
	<element name="FDTContentLinkage" type="fd:FDTContentLinkageType">
		<annotation>
			<documentation>
                Zero or more of these elements may appear as instantiations of the element wildcard in the FDT-InstanceType content model.
                When they do appear there, they shall specify the default content linkage tag(s) for all files in the FDT Instance.
                See Section 5.3 of [NRT].
            </documentation>
		</annotation>
	</element>
	<complexType name="FDTContentLinkageType">
		<simpleContent>
			<extension base="fd:ContentLinkageType">
				<anyAttribute processContents="skip"/>
			</extension>
		</simpleContent>
	</complexType>
	<element name="FileContentLinkage" type="fd:FileContentLinkageType">
		<annotation>
			<documentation>
                Zero or more of these elements may appear as instantiations of the element wildcard in the FileType content model.
                When they do appear there, they shall specify the content linkage tag(s) for that specific file.
                See Section 5.3 of [NRT].
            </documentation>
		</annotation>
	</element>
	<complexType name="FileContentLinkageType">
		<simpleContent>
			<extension base="fd:ContentLinkageType">
				<attribute name="entry" type="boolean" use="optional" default="false"/>
				<anyAttribute processContents="skip"/>
			</extension>
		</simpleContent>
	</complexType>
	<simpleType name="ContentLinkageType">
		<annotation>
			<documentation>
                ID used to group files in a content item.
                See Sections 4.3 and 5.3 of [NRT].
            </documentation>
		</annotation>
		<restriction base="unsignedInt">
			<minInclusive value="1"/>
		</restriction>
	</simpleType>
    <element name="MultiFileRequest">
        <complexType>
            <sequence>
                <element name="InitialFiles" type="fd:ListOfUrl"/>
                <element name="FileUpdates" type="fd:ListOfUrl"/>
            </sequence>
            <attribute name="majorProtocolVersion" type="fd:nibble" use="optional"/>
            <attribute name="minorProtocolVersion" type="fd:nibble" use="optional"/>
        </complexType>
    </element>
    
    <complexType name="ListOfUrl">
        <sequence>
            <element name="URL" type="anyURI" maxOccurs="unbounded"/>
        </sequence>
    </complexType>
    
    <simpleType name="nibble">
        <restriction base="unsignedByte">
            <maxInclusive value="15"/>
        </restriction>
    </simpleType>
</schema>
