HBCMS更多的中文手册参考:

t:SWITCH Element | switch Object

DHTML中文手册

Enables you to provide several choices and display content depending on which choice is true on the user's computer.

Members Table

AttributePropertyDescription
hasMedia Retrieves a Boolean value that indicates whether the element is an introduction to html+time media element.
systemBitrate Retrieves the approximate bandwidth available to the system in bits-per-second.
systemCaptions Indicates whether or not to display a text equivalent of the audio portion of the presentation.
systemLanguage Indicates whether a given language is selected in a user's system preferences.
systemOverdubOrSubtitle Specifies whether overdubs or subtitles render during a presentation.

Remarks

Use the t:SWITCH element to decide which content to display based on the value of test attributes such as systemcaptions, systembitrate, systemoverduborsubtitle, and systemLanguage.

This example detects the system language setting from the Regional Options in Control Panel and displays a text fragment in Spanish, Portuguese, or English, depending on the system language setting.

<t:switch>
<span class="time" systemLanguage="es" >Somos interdependientes (Espanol)</span>
<span class="time" systemLanguage="pt" >Nos somos interdependentes (Portuguese)</span>
<span class="time" systemLanguage="en" >We are interdependent (English)</span>
<span class="time">None of the above</span>
</t:switch>

Although different media-based elements exist, there is no functional difference in their current implementation. However, you are encouraged to use elements such as t:animation, t:audio, t:img, t:media, t:ref, and t:video for improved document readability and enhanced support.

the prefix t: is used to associate this element with an extensible markup language (xml) namespace. you must declare the xml namespace in the html tag of your document when using this element.

<html xmlns:t ="urn:schemas-microsoft-com:time">

you must then import the tag definitions from the time2 behavior by using the IMPORT processing instructions.

<?IMPORT namespace="t" implementation="#default#time2">

Within a switch block, all tags (including tags such as hr and BR) resolve true if they don't have valid test attributes. This has a couple of implications.

  1. The switch element is not effective as a time container for multiple elements because it stops rendering children after the first child resolves true. For this reason, the timecontainer attribute is ignored by the switch element.
  2. html comment tags always resolve true. to incorporate html comment tags in switch blocks, you must wrap them in another container, such as a div or t:par. the following code fragment demonstrates how to do this.
<t:switch>
<div systemLanguage="en" >
<!--This is the english language part -->
...
</div>
<t:par>
<!-- This is the catch-all part  -->
</t:par>
</t:switch>

This element is not rendered.

This element requires a closing tag.

更多语法参考

introduction to dhtml behaviors, introduction to html+time, time2, Using DHTML Behaviors