W3C home > Mailing lists > Public > www-forms@w3.org > May 2004

Client-Side XSLT & XForms

From: Claude JABOT <claude.jabot@iupmime.univ-lemans.fr>
Date: Fri, 14 May 2004 10:09:23 +0200 (MEST)
Message-ID: <28739.>
To: <www-forms@w3.org>


I'm a french studend so please excuse my english.

I'm new to XForms and I have a problem when trying to get XForm with a
client-side transformation in Javascript.

* Environnement :
	- IE 6
	- MSXML 4.0
	- FormsPlayer or XForms Processor Control (IBM)

* Process
	- an xml document with business data (without any presentation data)
	is transformed with an XSL stylesheet (with the presentation data :
table, forms element)
	- trandformation is done using a javascript function called at the onLoad
	- result of transformation is then put in the html document still using

Have a look on the existing source :

*** page.html***
		<script language="JavaScript" type="text/javascript">
			function init(){
				//*// Load XML
				var xml = new ActiveXObject("Msxml2.DOMDocument.4.0")
				xml.async = false;
				xml.resolveExternals = false;
				xml.validateOnParse = false;

				//*// Load XSL
				var xsl = new ActiveXObject("Msxml2.DOMDocument.4.0");
				xsl.async = false;

				// Transformation
				document.getElementById("NouvelleInstance").innerHTML =
	<body onLoad="init();">
		<div id="NouvelleInstance">

*** ctx.xml (sample)***
<?xml version="1.0" encoding="ISO-8859-1"?>

*** InstanceNewCF.xsl (sample) ***
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:output method="html" omit-xml-declaration="yes" indent="yes"/>

<xsl:template match="ADT">
	<!-- Description -->
			<col width="45%"></col>
			<col width="30%"></col>
			<col width="25%"></col>
		<tr id="TRApporteur">
			<xsl:when test="//TPO-APP[. >= 100]">
					<label class="obligatoire">Mandataire : </label>
					<input id="INIDApporteur" name="value"><xsl:value-of
						<label class="obligatoire">Mandataire : </label>
						<span id="IdAgence" tabindex="1"><xsl:value-of
						<span id="SELLibLongAgence" tabindex="2"><xsl:value-of

What I want to do is use xforms with this existing architecture :
- create the xforms model in the xslt using <xsl:copy-of select="."/> in
the xsl:template matching ADT node
- use xforms user interface element instead html forms

The proble is it doesn't work :
	- code is not interpreted with the IBM's XForms Processor Control
	- with FormsPlayer, if the model is hard-coded in the HTML page, Xforms
controls are display but they don't bind to the model (even if I use

It seems the XForms code *must* be write at the page load. Is there any
method to load the plugin dynamically ?

Does anybody have this problem ? Is it possible to do, with the actual
technologie, a client-side transformation using XSLT to produce a valide
XForms code who will be interpreted by an Xforms plugin ??

Thanks for your help

Best Regards

Received on Friday, 14 May 2004 04:20:14 UTC

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