RE: [xsl] I have the XSLT, now need to make it usable as user-inp ut form?

Subject: RE: [xsl] I have the XSLT, now need to make it usable as user-inp ut form?
From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx>
Date: Fri, 18 Apr 2003 16:28:34 -0400
Andrew,

Thank you for the example. I'm having a very hard time putting my brain
around applying this to my purpose. If possible, could you show me how
xforms would go with my xslt (not ALL of it of course!). A small piece of my
xsl follows.  Thanks!  kathy :-|

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                version="1.0">	
	<xsl:output method="html"/>	
	<!-- ========================================================= -->

	<!--  Standard On-Line Work Instruction Stylesheet 4/10/03     -->

	<!-- ========================================================= -->

	<xsl:template match="/">		
		<html>			
			<head>				
				<title>Example of XSLT</title>

			</head>			
			<body bgcolor="#DDDDDD">

				<h1><xsl:value-of
select="/work_instruction/title"/></h1>				
				<form method="POST">

				<xsl:apply-templates/>

				<p align="center">

				<input type="button" value="Next Procedure,
if Required"/>					</p>

				</form>			
			</body>		
		</html>	
	</xsl:template>

	<xsl:template match="safety">		
		<table border="1" width="100%" cellpadding="4">

			<tr bgcolor="red" valign="middle">

				<th colspan="2" align="left">

					<h3>SAFETY</h3>

				</th></tr>
			<xsl:apply-templates select="numbered_list/listitem"
mode="safety" />			</table>
			<br />
	</xsl:template>

		<xsl:template match="listitem" mode="safety">
			<tr><td>
			<table border="0">

			<tr>
				<td valign="top"><xsl:number
level="multiple" 
				format="1. " count="listitem" />&#160;</td>
				<td valign="top"><xsl:apply-templates/></td>
			</tr>
			</table>
			</td></tr>	
		</xsl:template>
	
</xsl:template> 


**************************
-----Original Message-----
From: Andrew Watt [mailto:andrew@xxxxxxxxxxxxxx]
Sent: Friday, April 18, 2003 4:14 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] I have the XSLT, now need to make it usable as
user-input form?


At 09:51 18/04/2003 -0400, you wrote:
>I've been reading a lot of posts re: xforms, etc., but it doesn't look as
if
>I could use my xsl (which would be unthinkable!).

Kathy,

I have posted a simple example of producing an XForms-containing document 
using XSLT. So you can safely discard the unthinkable idea that it would be 
impossible to use XSLT to produce XForms.

It does become interesting when you have XPath expressions in the XSLT that 
refer to the source XML document and other XPath expressions in the 
stylesheet which are literal values of XForms form control attributes. 
<grin/> It makes things very interesting first time round.


>My head is spinning


Ah! Join the club! :)

>...I could really use some
>pointers-in-the-right-direction for how to best/most easily accomplish the
>following:
>
>The xsl/xml instance presents the user with an html form of process steps
to
>follow. Each step has a checkbox (when checked I want to store the
>SystemTime in an attribute value), and there are several user input boxes
>along the way. When any user input is made, I do need to either check the
>value against the xml attribute (e.g., high/low) and/or record the data (in
>case it gets lost before a final form POST. My thought was to SAVE the xml
>instance each time the user action occurs, overwriting the xml file each
>time until the end of the process is reached.

In XForms probably it would be better simply to update the <jargon>instance 
data</jargon> then submit later - at least that's what I would be tempted 
to do.


>Does this make sense? Please point me in the right direction. How to
capture
>data as the user goes along AS AN XML INSTANCE?

XForms will soon be the answer as the W3C means to submit XML data, I 
think. It is currently at Candidate Recommendation.

The CR is not the most readable document the W3C has ever produced.

Micah Dubinko's draft of an XForms book he is writing is online at 
http://dubinko.info/writing/xforms/book.html. It is probably the most 
readable publicly available document on XForms of any length. But it has 
few complete examples.

BTW Microsoft's InfoPath (currently in beta) looks to have a very similar 
pattern of thought behind it. It uses XSLT (and JavaScript) under the
covers.

Andrew Watt



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread