Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

XForms Tutorial
Xforms Introduction
Binding the XForm Components
XForms Properties
Form Controls
Submitting Data to Xforms
XForms Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


Binding the XForm Components

Previous Next



What is binding in XForms?

As you read in the previos chapter, XForms accomplishes the data capture through two components, XForms Model and XForms User Interface. The connection between these two parts is called binding, and it uses the common W3C technology called as XPath.

In order to take the advantages of binding, form authors need to provide the XML template, called as instance data, which provides the place to reside for entered data. The instance of data can either be empty initially (for the blank form) or can hold an initial data (in case of the pre-populated form). The ref attribute on each of the form control, seen previously, actually holds the XPath expression that points to the location in an instance the data.

If you've had some sort of experience with XPath, you probably know that the XPath deals with a node-sets, where a node is the fundamental bit of the XML such as an element or an attribute. Whenever the XForms uses ref attribute, it aplies the first node rule, so that even if the XPath would normally return several nodes, only the first (in the order that things appears in a document) is used by the XForms. In contrast, the attribute node set indicates that the multiple nodes are in play.


A note on namespaces

Any of the serious XML work will inevitably run into an XML namespaces, with a telltale xmlns attributes. Since this is the XForms Institute, and not a Namespaces Institute, several of the simplifications are used here:

The default namespace
A default namespace is applied to an XHTML. It is possible that by the time XHTML 2 is finialized that an XForms will share a namespace, so the XForms elements too are considered as default. .

The user namespace
A prefix my: is used for most of the user-provided instance data.

Others
The few other namespace prefixes, such as ev: for an XML Events may appear, and it will be explained as needed.

Keep in mind that in the XPath expressions, no default namespace is applied, and thus the prefixes should be used liberally.


How the binding works

First of all, as the child of a model element, an element called as instance is needed to provide an instance of the data, which can be either an inline XML, or in the separate document pointed to by the src attribute. Cosider for an example, a fragment of the UBL document:

<model id="m1">
<instance>
<inv:Invoice>
<my:InvoiceLine>
<my:InvoicedQuantity unitCode="PKG">5</my:InvoicedQuantity>
<my:Item>
<my:Description>Box of Protractors; 500 count<my:Description>
</my:Item>
</my:InvoiceLine>
</inv:Invoice>
<instance>
<bind nodeset="my:InvoiceLine/my:Item/my:Description" required="1"/>
<submission id="s" method="put" action="po.xml"/>
<model>

This sample of code includes a submission element as before, and additionally an instance of the element populated with a real-world XML. It also has the bind element, the key to the power of an XForms: it can do work directly with nearly any kind of the XML in existence.

Others
A nodeset attribute gives the hint of how this element will work: it selects all of the my:Description elements in a document. In the purchase order, you would expect several of the line items to be present, each with the description field. An XPath expression do selects them all, and applies the property called "required" to each of them.

An XPath works much like the directory path, with each step descending one level into an XML. An attribute step is accomplished with the leading character @, as in an html:a/@href.




Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previous Next

Keywords: vb net components,binding vb net,asp net binding, xml components, java components, net components, c# components


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.