What is XForms?


So what exactly is XForms? XForms is an XML grammar in which you can define a form. It is separated into three parts: data (instance), display (control definition, and binding), and action (submission). Looking at a typical HTML form, we have a form tag that defines its action, which is where the form submits to. In XForms, submitting a form can do different thingssubmit to an HTML page, copy a file, or other things. This is the "submission" part of XForms. You then define the form controls, which define the display elements. In more general terms, what you are actually defining is what types of decisions the user can makefor example, "choose one of these options" (a radio button or single select) or "submit the form now" (an image or submit button.) In addition, using "value=", selected, checked, and embedded textbox text defines the values that these controls initially have. Since XForms separates the data from the display, those values are defined in the "data" section of XForms and the controls and what data is displayed in them is defined in the "bind", or controls section (which data is bound to which control).

Once XForms defines the information in XML, your browser still can't display itall your browser understands is HTML. Therefore, it requires both an XForms XML document and something that translates it into HTML. HTML (or at least, the better formed version of it, XHTML) is an XML grammar, so this is accomplished using XSLT, which means eXtensible Stylesheet Language Transformations. XSLT defines transformations that you can use to define how to translate an XML document into another XML document. XSL is the language that is used by XSLT to define these transformations, so in order to have a complete system you'll need both an XForms form definition and an XSL document that describes how to translate that forms definition into something displayed. We'll see in this chapter how ColdFusion creates XForms, and how it uses XSL to render them.



Advanced Macromedia ColdFusion MX 7 Application Development
Advanced Macromedia ColdFusion MX 7 Application Development
ISBN: 0321292693
EAN: 2147483647
Year: 2006
Pages: 240
Authors: Ben Forta, et al

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net