Re: Using XSL-T to convert XForm to HTML: Impossible?

Hello,

I can explain how the stylesheet works, no more because this work is owned 
by my company (Software AG)
A web site using the stylesheet will be soon available but in french. The 
location will be http://www.altaprofits.com .

What I did is very simple. There is a runtime (called xforms.js) located in 
/scripts directory of the web server.
The script defines Javascript classes that look like the last XForm data 
model objects like "string" or "number" or "boolean".
The classes are in a common inheritance tree (or something like this, it's 
Javascript don't forget !). Each class has got standard methods
like "getValue()", "setValue()", "checkFormat()",etc... and event handlers 
like "Notify()".
Moreover the runtime gives routines to bind Javascipt objects to html form 
elements, to build a response document, to display messages and to post the 
response.
The runtime is 40Kb size and is shared so downloaded once.

The stylesheet needs an XML document as input with XForms model, instance 
data and presentation melted.
In fact model definition and instance data can be somewhere else using an 
"href" attribute.

The stylesheet :

- Adds the Javascript include tag for the runtime
- Creates an XForm object and sets protocol attributes like "action" and 
"method" (default method is "POSTXML")
- Browses the model definition and build the XForm data tree.
- Browses the instance data and initializes the data tree with these.
- Adds event handlers to the HTML form and its elements
- Does some small features like sizing controls using data model 
definition...

Some interesting features are :
- Data format checking
- Values in data tree and in controls can be different so managing locales 
is very easy
- The attribute "validate" can be used with Javascript code
- There is a macro interpreter in the stylesheet (I needed it to initialize 
a date with "now()")
- I added currency management that's not complete in the data model
- I added help strings to gives friendlier names than tag names in error 
messages.
- The form posts an XML document using the "_process" parameter so an XForm 
response can directly be stored in Tamino
- Several XForms can live in the same HTML page

Some work is needed :
- Extensible arrays but the most difficult is about DHTML in fact ! (60% of 
the work is already done)
- The stylesheet has some troubles copying some heretic HTML structures
- to manage several locales


I will be pleased to help you if you plan to do something like this.

Regards,
Jerome




>From: "Schulze, Matthias" <schulze@dresden-informatik.de>
>To: 'Jerome Marc' <marcjero@hotmail.com>, www-forms@w3.org
>Subject: Re: Using XSL-T to convert XForm to HTML: Impossible?
>Date: Mon, 25 Sep 2000 17:58:18 +0200
>
> > I agree with you XSLT can do the transformation. I made a stylesheet 
>that
> > generates IE4 and Netscape 4.0 compatible DHTML. It'not so heavy because 
>I
>
> > wrote a Javascript runtime in a .js file. The runtime is about 40K and 
>is
> > shared (downloaded once) between XForms generated pages.
>
>Very interesting! Would you please be so kind to reveal some further
>details?!
>In particular I'm curious to which extent your stylesheet may emulate the
>XForms data model and requirements.
>
>Thanks,
>
>Matthias

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.

Received on Monday, 25 September 2000 15:36:54 UTC