[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Fw: XML Form-Filling System : an example

  • To: <xml-dev@l...>
  • Subject: Fw: XML Form-Filling System : an example
  • From: "Dimitris Pantazopoulos" <dgp@h...>
  • Date: Sun, 16 Nov 2003 11:41:27 +0200

xml form example

----- Original Message ----- 
From: "Dimitrios Pantazopoulos" <dpant@y...>
To: <ukitse01@a...>
Sent: Sunday, November 16, 2003 11:37 AM
Subject: XML Form-Filling System : an example


> Hello Sella,
> 
> My dissertation contains a case study entitled "The
> Exams Registration Form". So, here is how the XML
> Form-Filling system works:
> 
> First, you have to describe the XML form in an XML
> document:
> 
>   <?xml version="1.0" encoding="UTF-8"?>
>   <?xml stylesheet type="text/xsl" href="THE XSLT"?>
>   <!DOCTYPE xmlform SYSTEM "THE DTD.dtd">
>   <xmlform id="examsregform" parser="xmlformparser">
>     <static>Exams Registration Form</static>
>     <static>Please, fill in the following
> information:</static>
>     <hole id="fullname">
>       <label>Name</label>
>       <text length="40" accesskey="N">
>         <validation>
>     <minsize>1</minsize>
>   <error>Please, enter your full name</error>
> </validation>
>       </text>
>       <data href="THE XML FILLING
> DOC.xml#id(fullname)" show="embed" actuate="auto"
> xml:link="simple"/>
>     </hole>
>   </xmlform>
> 
> The above is a tiny XML form with some plain text
> (<static>) and a textbox (<text>). Each HTML form
> control (e.g.textboxes, checkboxes etc) are considered
> as "holes". A "hole" is not just the XML descriprion
> of the HTML control. 
> 
> It also describes how the control is validated on the
> client-side (<validation>) and how it is linked to
> data (<data>).
> 
> In our example there is only one hole uniquely
> identified as "fullname". When the XML document will
> be transformed into HTML via the XSLT the hole will be
> rendered as a textbox. The XSLT will also produce the
> necessary client-side 
> 
> javascript code to validate the textbox against the
> <minsize> rule: There should be at least one character
> filled in. 
> 
> If validation fails the javascript will pop-up the
> <error> message. The generated javascript code should
> be something as simple as:
> 
> if (length < 1) 
> {
>    alert("Please, enter your full name");
>    return (false);
> }
> 
> Now, let's assume that the user fills in the textbox
> with data (e.g. the word "testing") and submits the
> form. A new XML document will be generated to hold
> that data. I call this document an "XML filling
> document". In our example it should be something like
> this:
> 
>    <?xml version="1.0"?>
>    <examsregform>
>       <fvalue id="fullname">testing</fvalue>
>    </examsregform>
> 
> My Form-Filling system generates the XML filling
> document on the client-side using the javascript
> FileSystemObject. 
> 
> In the mailing list it was suggested that data are
> sent to the server and such a document is created on
> the server-side. Sure, this is another feasible
> option.
> 
> Now, let's get to the most interesting part. Why do we
> ever want to have XML forms? One part of the answer is
> that first and foremost we want the submitted data (if
> any) to be retrieved and displayed each time the form
> is requested. 
> 
> In other words, we want to be able to modify our
> previously entered data or continue filling in a
> partially filled form. (Actually, one has to read the
> whole dissertation to find all the reasoning behind
> XML forms.)
> 
> Data are retrieved from the XML filling document. They
> are connected to the XML form via the <data> XLink
> nodes. In our example, the "fullname" hole contains a
> <data> node that points to the <fvalue id="fullname">
> node of the XML filling document. 
> 
> The XML Form document is enriched with such <fvalue>
> nodes before the XSLT is called. This process is
> called transclusion. What the XSLT really sees after
> the transclusion takes place is something like this:
> 
>   ...
>   <xmlform id="examsregform" parser="xmlformparser">
>   ...
>     <hole id="fullname">
>       <label>Name</label>
>       <text length="40" accesskey="N">
>          <validation>
>     <minsize>1</minsize>
>       <error>Please, enter your full name</error>
> </validation>
>        </text>
>        <data href="THE XML FILLING
> DOCUMENT.xml#id(fullname)">
>          <fvalue id="fullname">testing</fvalue>
>        </data>
>     </hole>
>   </xmlform> 
> 
> The XSLT can now render the XML Form into an HTML form
> with its control pre-filled with their data. In our
> example, the textbox will contain the "testing" value.
> Of course, if the XML filling document cannot be found
> or it does not exist (e.g. the first time the form is
> requested) the textbox will be empty.
> 
> Transclusion is performed by a Transcluding Browser
> created at the University of Edinburgh. Unfortunately,
> no other browser currently supports such a notion. Two
> years later, there is still no XLink-capable browser. 
> 
> Last but not least, a few words about the DTD file
> (see the XML form document). Everything is my
> dissertation is formally and syntactically described
> using a DTD. This means that constructing an XML form
> and XML filling document follows certain rules. This
> is of paramount importance for the transcluding
> browser which uses such information to perform the
> transclusion.
> 
> I guess this is it. If you have difficulty in
> following at some point please let me know. 
> 
> Hope this helps,
> Dimitris
> 
> ________________________________________________________________________
> Want to chat instantly with your online friends?  Get the FREE Yahoo!
> Messenger http://mail.messenger.yahoo.co.uk



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.