OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Fw: XML Form-Filling System : an example

[ Lists Home | Date Index | Thread Index ]


----- Original Message ----- 
From: "Dimitrios Pantazopoulos" <dpant@yahoo.com>
To: <ukitse01@achichu.com>
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






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS