The ephox:items and ephox:displayitems attributes are used together to specify the items to display in combo boxes, editable combo boxes and lists. ephox:displayitems is used to specify the items to display to the user and ephox:items is used to specify the corresponding values to insert into the XML. The ephox:items and ephox:displayitems attributes should only be used within XSL value-of elements.
The ephox:items attribute is used to specify a list of values for combo boxes, editable combo boxes and lists. The value is a comma separated list of items. When ephox:items is used without ephox:displayitems each item is displayed to the user, and when selected inserted into the XML. However when ephox:displayitems is used, the items in ephox:displayitems are displayed to the user and when selected, the corresponding item in ephox:items is inserted into the XML. The ephox:items attribute should only be used within XSL value-of elements.
When ephox:items is not specified, the values for combo boxes, editable combo boxes and lists are taken from the schema for the document.
The value of the ephox:items attribute must be a comma separated list of items. This list represents the list of values which may be inserted into the XML document for the relevant element or attribute. When using the ephox:items attribute in tandem with the ephox:displayitems attribute the number of items in the comma separated lists for each attribute must match.
The ephox:displayitems attribute is used to specify a list of items to display in combo boxes, editable combo boxes and lists. The value is a comma separated list of items to display. ephox:displayitems must be used with either ephox:items or a schema type that has enumeration facets specifying allowed values. Each item in ephox:displayitems corresponds in order to an item in ephox:items or the schema enumerations and is used as a user friendly version of the value. There must be exactly the same number of items in ephox:displayitems as there are specified values. The ephox:displayitems attribute should only be used within XSL value-of elements.
The value of the ephox:displayitems attribute must be a comma separated list of items. This list represents the list of values which are displayed for the relevant element or attribute in the XML document. When using the ephox:displayitems attribute in tandem with the ephox:items attribute the number of items in the comma separated lists for each attribute must match.
The example below will display as a combo box with the items:
Item 1
Item 2
Item 3
When the user selects an item, the value from ephox:items will be inserted. For example if Item 1 is selected by the user item1 will be inserted into the XML. Similarly if the user selects Item 3, item3 will be inserted into the XML.
<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" />
The example below will display as a list with the items:
item1
item2
item3
When the user selects an item it will be inserted into the XML exactly as it is displayed.
<xs:value-of select="." ephox:displayas="combo" ephox:items="item1,item2,item3" xmlns:ephox="http://www.ephox.com/product/editliveforxml/1.0" />
ephox:displayitems can be used without ephox:items if the type in the schema uses enumeration facets to specify a list of allowed values. In this case, ephox:displayitems provides a user friendly form for each enumerated value. If the schema declares an element as:
<xsd:element name="favoriteEditor">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="elx" />
<xsd:enumeration value="elj" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>The XSLT designer may wish to provide a more intuitive list of items for the user to select from. The XSLT snippet will achieve this.
<xs:value-of select="my:favoriteEditor" ephox:displayitems="EditLive! for XML,EditLive! for Java" xmlns:ephox="http://www.ephox.com/product/editliveforxml/1.0" />
Copyright 2001-2004 Ephox Corporation. All Rights Reserved.