SEM Labs

Handcrafted Pixels, Code & Title Tags

Format

Elements

The XFL format element formats values during the initial population of the form. For example if you want to convert an integer into a string with group thousands.

It should be noted that as per the XML specification, all text outputted by the XFL parser will be escaped. This means that & will become & and & will become &. This is not a bug, see the XML specification for more information on XML entities. Ideally, all text in applications should be stored raw and formatted for the medium it is being outputted to, i.e. raw text, HTML, PDF etc.

Dissection of the XFL Format Element

Syntax

Attributes

Attribute Value Description Required
type method name method to execute in the XFL_Format class Yes
value text value to pass to the method No
select XPath query XPath query to retrive a value from data (post or population data) No

Processing Information

XFL Format elements will execute the method defined in the type attribute in the XFL_Format class. Custom formatting can be created by adding new methods to the XFL_Format class.

Built-in Functions

XFL comes with the following formatting methods built in.

numberFormat

The numberFormat formatter will group integers into thousands using a comma.

Example:

Outcome:

The value of the node will become 10,000.