CDF Tags for Mobile Channels

Additional tags recognized by Mobile Channels are described in the following table.

Tag Description
CHANSCRIPT Identifies the ID of the script file to render the channel and subchannels.
ITEMSCRIPT Identifies the ID of the script file to render the item data file.
ITEMFORMAT Defines the file structure for data files.

The following list documents each tag in detail:

The CHANSCRIPT tag is used as follows:

<CHANSCRIPT VALUE="ChannelID"/>

The CHANSCRIPT tag specifies an HTML page or a Mobile Channels script (MCS) that displays a channel. The CHANSCRIPT tag value applies to all child channels of the current channel or subchannel. Thus, every subchannel must have its own CHANSCRIPT tag unless the subchannel is script-generated and the associated script is capable of generating multiple views. This tag supersedes the CHANSCRIPT value previously defined by a parent CHANNEL element, if any exist. The VALUE attribute specifies the ID of the ITEM element corresponding to the script that renders this level of the channel. For example,

<CHANSCRIPT VALUE="ChanScript1"/>

where the channel script identified by “ChanScript1” has been defined elsewhere in the CDF file, say, as follows:

<ITEM HREF="http://www.microsoft.com/channel.mcs" ID="ChanScript1">
    <USAGE VALUE="None"/>
</ITEM>

The top-level CHANNEL element can have at least one CHANSCRIPT tag as the child element. Each subchannel can have, at most, one such tag.

Here, vi is the field name of the block value and ti is the optional type of the block value. If ti is omitted, the default value “HTML” is assumed. Valid types are described in the following table.

Type Description
HTML HTML text including markup
TEXT Same as HTML, but without markup
IMG ID of image item in CDF files
HREF URL to a page, for example, a data file or channel script

A data block is merely a group of values, with one value per line. Any meaningful data file should have at least one data block. For example, three data blocks might be used to show a portfolio of three stocks. The following code example shows how the Market mobile channel displays stock values listed in the Stocks.mcd file. The header gives the title and displays the date of the shown stocks. The data to be listed includes the name, the low price, high price, and closing prices of each stock.

<ITEM HREF="http://www.microsoft.com/Stocks.mcs" ID="Stock_S">
   <USAGE VALUE="None"/>
</ITEM>
. . . 
<CHANNEL ID= "Stock_C">
   <TITLE>Market</TITLE>
   <ITEM HREF="http://www.microsoft.com/Stocks.mcd" ID="Stock_D">
       <USAGE VALUE="MobileChannel"/>
       <ITEMSCRIPT VALUE="Stock_S"/>
       <ITEMFORMAT VALUE ="Title,Date,Picture=IMG;
                          Name,Low,High,Close"/>
   </ITEM>
</CHANNEL>

Here, the header block has three values, Title, Date, and Picture, and the data block has four: Name, Low, High, and Close.

IMG indicates the field that represents an image, such as a JPEG or GIF file. The field value is the identifier of the item defining the image URL. The built-in item script creates an IMG value to display this item.

The data block may be repeated to build a table of stock prices. If the Stocks.mcd file contains a single data block, the script displays a single stock per page. If it has multiple data blocks, the script could display a table of stocks.

The following code example — which represents a news article with a title, an image, and the body of text — shows that the repeat block can be omitted.

<ITEMFORMAT VALUE="TITLE, PICTURE=IMG, BODY;"/>

The following code example — which represents a page with stock listings — shows that the header block can be omitted. The semi-colon (;) is used to indicate the value list; it is the repeat block and not a header block.

<ITEMFORMAT VALUE =";Name, Low, High, Close"/>