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

Re: advocating XML

  • From: "Thomas B. Passin" <tpassin@h...>
  • To: xml-dev@l...
  • Date: Tue, 13 Mar 2001 21:58:10 -0500

xml questionnaire
Rob Andrews wrote -

> Thanks (all) for several useful replies, which have helped us move toward a
> more intelligent discussion here.
>
 One more point to add to the mix.   XHMTL doesn't have to be bloated.  In
fact, it can just be html, but well-formed.  Once you are writing it that way,
you can start adding more with.

Let me give you a real-life example I recently worked on.  A colleague wanted
to send out a questionnaire to several hundred people.  It was long and
involved.  I was asked to help "get the data into a database".  The budget was
low.

I developed an xml format (a dtd) for a generalized questionnaire (crude but
useful), and an xslt stylesheet that turned it into an html form.  A big
problem with this kind of thing is assigning names to the form elements - we
had more than 100 input elements.  I wrote a python SAX script that took the
source xml and numbered each response (check box, radio button, etc.) with a
unique number like "q1"," q2", .....  The output was the same xml format but
with everything named properly.  From this I created the actual online form
using the stylesheet.

Next I wrote an xslt stylsheet that created the database table definition in
sql ddl.  Running that output created the exact table I needed for that
version of the questionnaire.  This is a program generator in xslt!

Next came a modified version of the first stylesheet.  This version displayed
the form with the input names visible next to the elements.  This information
is essential in writing queries.

Finally, I modified the stylesheet again to produce a Zope DTML (Zope's
template markup language) page to display the raw answered questionnaire for
each respondent (it got the data from the database).  This let us get a quick
look at the results.

By using these stylesheets, the form, the database table, the results crib
sheet, and the raw results are automatically kept accurately synchronized.
That would be very arduous and error-prone if you did it by hand.  You could
use comma-separed files to hold the descriptions of the form, but they would
be fragile and hard to keep correct as you  made changes.  They also wouldn't
reflect the section-within-section format of the questionnaire.  With xml, it
was almost a no-brainer once I had written the machinery.

And as a bonus, the system can be used for other questionnaires, too.

Try doing that with plain html and comma-separated files.  xml was MUCH
better.

Cheers,

Tom P




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.