How to Create a Dropdown List Using XSL
XSL, also known as XSLT, is a programming language that functions as a combination of extensible markup language (XML) with cascading style sheets (CSS). XSL stands for extensible style sheet language and allows developers to build CSS-like elements for pages that are programmed using XML.
Instructions
-
-
1
Launch a text-editing program, such as Microsoft Notepad or Mac OS X's TextEdit, which you can use to code an XSL drop-down menu.
-
2
Save the document before you begin and give the XSL file a name.
-
-
3
Paste the following snippet of code into the document to create a drop-down menu in XSL:
<select name="status" class="required">
<xsl:apply-templates select="document('mydoc.xsd')//xs:simpleType[@name = 'status']/descendant::xs:enumeration" mode="generate-options">
<xsl:with-param name="selected" select="@status" />
</xsl:apply-templates>
</select>
-
4
Replace "mydoc.xsd" in the example of code above with the file name that you wish to use when the form generates data and is filled out by a website user.
-
1