6.4 String Functions


XPath provides a standard set of functions for string manipulation, and these are felt to be adequate for forms-based applications. This section defines string function property provided by the XForms core function library.

Function property takes a single string argument that names a feature of an XForms implementation and returns a string value describing that feature. Possible values for the argument to function property along with the defined return values are shown in Table 6.2.

We illustrate the use of function property in Figure 6.3 with a sample that displays information about the XForms client that is processing the page.

Figure 6.3 Displaying information about the XForms processor using function property .
 <  group   xmlns  ="http://www.w3.org/2002/xforms">   This XML powered web form uses XForms   <  output   value  ="property('version')"/>   and conforms to   <  output   value  ="property('conformance-level')"/> </  group  > 

When loaded into a browser that implements all features of XForms 1.0, this might display the output shown in Figure 6.4.

Figure 6.4 Time-stamping a time card using function now .
 <  model   id  ="tc"  xmlns  ="http://www.w3.org/2002/xforms"  xmlns:xsd  ="http://www.w3.org/2001/XMLSchema">   <  instance  >     <  tc   xmlns  ="">...<  stamp   xsi:type  ="xsd:date"/></  tc  >   </  instance  >   <  submission   id  ="submit-tc">     <  action  >       <  setvalue   ref  ="/tc/stamp"  value  ="now()"/>       <  message  >Submitted your time-card  with         time-stamp <  output   ref  ="/tc/stamp"/>     </  message  ></  action  > </  submission  ></  model  > 
Table 6.2. Function Property ”Arguments and Return Values

Argument

Return

Description

version

1.0

Specification Version

conformance-level

full

XForms Full

 

basic

XForms Basic

This XML powered Web form uses XForms 1.0 and is being displayed by an XForms user agent that conforms to profile XForms full .



XForms. XML Powered Web Forms with CD
XForms. XML Powered Web Forms with CD
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 94

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