ephox:displayas Attribute

The ephox:displayas attribute allows the designer of the XSLT to specify an alternate control type when displaying values from the XML document. By default, EditLive! for XML automatically selects the type of control to use based on the type specified in the schema. However, in some circumstances it is useful to override the default choice and ephox:displayas provides a way to do so. It can only be used within value-of XSL elements.

Possible Values

The ephox:displayas attribute can only be used within value-of XSL elements and its value must be one of the following:

field

Use a standard text box. The user may enter any value without restriction.

password

A password text box is used. The user may enter any value without restriction, however the current value is shown only as bullets rather than showing the actual characters. This is suitable for allowing the user to enter a password while preventing by-standers from seeing the password. Note that the actual value is inserted into the XML document without any encryption and will be visible when submitted or if the user switches to code view. When security is a concern, HTTPS should be used to submit the document.

checkbox

A checkbox is used to allow the user to specify either true or false. If the checkbox is checked, true will be inserted into the XML file, otherwise false will be inserted. It is not currently possible to specify different values to insert - in these cases a combo box or list should be used instead.

combo

A combo box is used and the user must select one of the options from the combo box. The items in the combo box are specified with the ephox:items attribute and the ephox:displayitems attribute.

editableCombo

Uses a combo box that will allow the user to select an item from a drop down or type in their own value. The items in the drop down are specified with the ephox:items attribute and the ephox:displayitems attribute.

list

A list is used and the user must select one of the values in the list. A scroll bar is provided if the number of list items exceeds the available space. The items in the list are specifed with the ephox:items attribute and the ephox:displayitems attribute.

date

A date picker is provided for the user to select from. The value inserted into the XML is compatible with the W3C schema date type.

time

A time picker is used.

dateTime

A combination control that allows the user to specify and date and time value is provided.

Examples

Using a Standard Field

<xs:value-of select="." ephox:displayas="field"
  xmlns:ephox="http://www.ephox.com/product/editliveforxml/1.0"/>

Using a Password Field

<xs:value-of select="." ephox:displayas="password"
  xmlns:ephox="http://www.ephox.com/product/editliveforxml/1.0" />

Using a Check Box

<xs:value-of select="." ephox:displayas="checkbox"
  xmlns:ephox="http://www.ephox.com/product/editliveforxml/1.0" />

Using a Combo Box

<xs:value-of select="." ephox:displayas="combo" 
  ephox:items="item1,item2,item3" ephox:displayitems="Item 1,Item 2,Item 3" 
  xmlns:ephox="http://www.ephox.com/product/editliveforxml/1.0" />

Using an Editable Combo Box

<xs:value-of select="." ephox:displayas="editableCombo" 
  ephox:items="item1,item2,item3" ephox:displayitems="Item 1,Item 2,Item 3" 
  xmlns:ephox="http://www.ephox.com/product/editliveforxml/1.0" />

Using a Date Picker

<xs:value-of select="." ephox:displayas="date"
  xmlns:ephox="http://www.ephox.com/product/editliveforxml/1.0" />

Using a Time Picker

<xs:value-of select="." ephox:displayas="time"
  xmlns:ephox="http://www.ephox.com/product/editliveforxml/1.0" />

Using a Date and Time Picker

<xs:value-of select="." ephox:displayas="dateTime"
  xmlns:ephox="http://www.ephox.com/product/editliveforxml/1.0" />