W3C home > Mailing lists > Public > www-forms@w3.org > August 2002

RE: xforms in xhtml, styled using xsl?

From: Dan Dennedy <DDennedy@digitalbang.com>
Date: Fri, 16 Aug 2002 16:02:12 -0400
Message-ID: <11DC9B322580C843AE5A3D030D950B030315A3@intrabang01.digitalbang.com>
To: "alex" <shortestpath@yahoo.com>, <www-forms@w3.org>

> From: alex 
> does anyone know of an example out there that uses 
> xforms in xhtml, and styled one the client side with 
> xsl?
Do you imply that the xforms processor is on the client or server? If on
the server, then most examples would use css with xhtml rather than
xslt. There is not much value in using xslt to style xhtml; typically
xslt is used on the client to style other xml. There are only a few
public xforms implementations. x-smiles has a few examples of using
xhtml, xforms, and css.

There are some public server-side implementations that use xslt as part
of the processor, but I don't know much details. For instance, Chiba1
seems to only support standalone xforms docs, while Chiba2 supports
xhtml+xforms (but not xslt+xhtml+xforms?). Apache (Cocoon?) is working
on something too.

My personal, private server-side processor under development does allow
one to combine xhtml with xforms and xslt. It has a xslt pre-processing
stage that let's one use xhtml+xforms inside an xslt. First, any
external references to instance data are expanded and run against the
document using xslt to generate xhtml+xforms. Then, the processor
processes the xforms in the result creating an expanded and extended
xhtml+xforms. That result is run through another xslt into xhtml+css.
This lets one author in the familiar model of xml data + xslt to output
xhtml+css. The last xslt stage offers some flexibility in how the
processor generates its xhtml because the xslt can be swapped out with a
variation--just in case.

ok, here is my example:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	<xsl:output method="xml" version="1.0" indent="yes"/>
	<xsl:template match="xforms:instance">
			<title>Edit User</title>
			<xforms:model id="user">
				<xforms:submitInfo id="submitUser"
action="success.html" replace="all"/>
				<xforms:bind ref="lastname"
			<xforms:group model="user">
				<xforms:caption>Edit User
				<xforms:input ref="firstname" cols="60">
				<xforms:input ref="lastname" cols="60">


A couple of implementation notes... 

1. I use the submitInfo/@action to specify where to go next after a
successful post. The form actually always posts back to itself to invoke
the processor. This is effectively the same as action specifying a form
handler whose response body is some new page anyway.

2. My instance points to an xml database (persistent dom) that I am also
working on.
Received on Friday, 16 August 2002 16:03:02 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:06 UTC