SEM Labs

Handcrafted Pixels, Code & Title Tags

Syntax

XFL

XFL syntax is simple, using logical element names and attributes. XFL follows the same rules as other XML documents as recommended by the W3C.

XFL Documents Must Follow A Schema

All XFL documents must begin with an xfl element (lowercase). This element must define the XFL namespace (xmlns) and must contain exactly one HTML form element. XFL document should also begin with an XML declaration. An example XFL document can be seen above.

XFL Elements Are Part of the XFL Namespace

All XFL elements are required to be part of the XFL namespace. A namespace is a feature of XML that allows different XML languages to exist in the same document, but be distinguishable from one another. In the above example, the first element is not part of a namespace, but the second one is part of the XFL namespace; this is signified by the 'xfl:' suffix.

XFL Elements are Case Sensitive

All XFL nodes must be lowercase. In the above example, the first node would be recognised as an XFL node while the second would not. Additionally, all HTML elements in XFL documents must be lowercase.

XFL Elements Must be Closed

All XFL nodes must have a closing tag or be self closing. In the above example, the first two elements are valid, while the second is invalid and will trigger an error. Additionally, all HTML elements within XFL documents must be properly closed.

HTML elements need not be closed in the required fashion to validate as XHTML.

Once parsed by the XFL parser, the above HTML input element will be outputted as:

XFL Elements Must Be Properly Nested

The above example shows two nodes that are incorrectly nested. This will trigger and error in the XFL parser. The nodes should be nested as follows:

XFL Attribute Values Must Be Quoted

Much the same as in any other well-formed XML document, all attribute values in XFL documents must be quoted. In the above example, the second element will trigger an error.