XML schema: XForms and customer invoices



The XForms XML standard defines the different components of a form (fields, radio buttons, lists, and other input controls) and the information validation that you want to provide in the form.
XForms XML standards are very similar to HTML and XHTML form tags familiar to Web developers and will become part of the XHTML 2.0 standard.
XForms XML is based on simple model, view, and controller formats. The model is the overall description of the form, including fields, input constraints and data submission. Views define the control, grouping, and model fields that appear in the form. The format and presentation of form controls are controlled by CSS.
The XForms standard extends the traditional HTML form definition by partitioning form information in more detail. Dynamic elements can be used in filling in forms (currently only through JavaScript or Ajax elements).
You can see a simple text input box and a pop-up selection box in Listing 11.
Listing 11. Simple text input box and pop-up selection box

<html xmlns=”http://www.w3.org/1999/xhtml”



<title>XForms Sample</title>



<Name xmlns=””>

<FName />

<LName />

<Title />






<xforms:select1 ref=”Title”>











<xforms:input ref=”FName”>

<xforms:label>First name: </xforms:label>


<xforms:input ref=”LName”>

<xforms:label>Last name: </xforms:label>


<hr />

<xforms:output value=”concat(‘Hello ‘,Title,’ ‘,FName,’ ‘,LName)”>

<xforms:label>Output: </xforms:label>




The XForms form can be viewed through the Firefox XForms extension. The results are shown in Figure 2.
Figure 2. View XForms forms using Firefox XForms extensions
使用 Firefox XForms 扩展查看 XForms 表单Customer invoice
An old problem in many business activities is the migration from paper customer invoice systems to computer processing. Creating invoice structures requires careful consideration of various types and repetitive elements.
In the past, the exchange of business information such as invoices had to establish a very large structure and definition. International invoice information exchange standards included hundreds of fields. Sharing invoices, orders and other data can be very difficult without an effective way of exchanging data.
Because there is no uniform standard, many organizations have developed various versions of the core invoice standard. Among them, the standards developed by the OASIS group may be the most well-known and recognized by a large number of companies and organizations.
This structure is part of the larger framework Universal Business Logic (UBL) developed by OASIS, which includes a variety of modes and workflows, ranging from orders, printing invoices to payment. This system is too complex to be discussed in this article, but if you need a flexible and interoperable system, UBL is a good starting point.