SEM Labs

Handcrafted Pixels, Code & Title Tags

XFL

XFL

eXtensible Form Language (XFL) is a transformation language that transforms arrays into HTML forms. For XFL documents to be transformed into working forms a parser is required – currently available in PHP. The latest version can be downloaded here.

The idea behind XFL is to automate, simplify and standardise common aspects of dealing with HTML forms on the server-side, namely populating forms and processing data.

What You Should Know

To start building forms using XFL, you should have some knowledge of XML or XML languages (such as XHTML), PHP and XPath. Knowledge of XML namespaces would be beneficial. Even with minimal knowledge of XML and PHP, it should be relatively simple to construct forms using XFL by reading the documentation.

What is XFL?

XFL is a brand of XML that defines how forms should be displayed and processed. XFL documents may be stored on a storage device or generated dynamically.

  • XFL is a markup language much like XHTML
  • XFL is designed to be self descriptive
  • XFL elements are always defined in the XFL namespace
  • XFL forms are just like regular HTML forms with the addition of XFL elements.
  • XFL documents contain mixed XFL and (X)HTML elements
  • XFL is extendible, you can create your own tags to provide desired functionality
  • XFL is open source, released under the MIT licence
  • XFL was not created or is associated with the W3C
  • XFL documents do not execute any processing. They are instructions, which are interpreted by a parser

What is the XFL parser?

The XFL parser is a PHP class that interprets XFL documents, processes submitted values and outputs HTML forms.

  • The XFL parser automatically populates form fields, binding associative arrays to their corresponding fields
  • The XFL parser formats, validates and sanitises data based on definitions in the XFL file
  • The XFL parser will automatically remove bogus data posted to forms in code injection attacks
  • The XFL parser provides a standardised method for forms to be handled
  • The XFL parser automatically generates errors and can add classes to erroneous fields
  • The XFL parser uses related classes to provide extendible functionality