[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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: Tue, 22 Apr 2003 13:38:43 -0400

Thank you. Two quick questions:

>These I don't put in an HTML form...

My HTML form is created by applying XSLT templates. For example, a <measure>
element becomes an input box with the @Name applied in the XML. All
templates spring from a simple structure:

<html>
<head></head>
<body>
<xsl:apply-templates />
</body>
</html>

Then I was hoping to just add some vb or javascript to the form as
needed...is it feasible to do it this way?

>I write a JavaScript which captures the user's input and constructs an XML
string (a 
>well-formed, serialized document, if you will)...

Any way you could show me a bit of an example...?

Thanks again, the information from this list is at least leading me in the
right direction, I think!

Kathy

-----Original Message-----
From: cknell@xxxxxxxxxx [mailto:cknell@xxxxxxxxxx]
Sent: Tuesday, April 22, 2003 2:21 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: RE: [xsl] I have the XSLT, now need to make it usable
asuser-inp ut form?


> -----Original Message-----
> From:     "Kathy Burke" <Kathy_Burke@xxxxxxxxx>
> 
> I wanted to ... save the entire XML instance to a field in a 
> database, then call upon that info using
> XSLT etc.
> 

Exactly how it's done depends on the nature of the program receiving the
content of the HTML form. That is to say, the specifics of the server-side
code depend on the HTTP server and the database. Are you using IIS or
Apache, Java Server Pages, or ActiveServer Pages, or Perl CGI scripts? The
answers to those questions will give you the particulars, but in general,
here's how I handle it.

I place user input controls on the HTML page to permit the user to add and
modify data. These I don't put in an HTML form, because I'm not going to
send those values directly to the server. Instead, I create a form
containing a single text input control and set the form's action attribute
to the server handler and the form's style.display property to "none".

I write a JavaScript which captures the user's input and constructs an XML
string (a well-formed, serialized document, if you will). When whatever I
set up to cause the update to the database occurs (usually a button click),
I call the JavaScript function that assembles the XML from the user input
controls, set the value of the hidden text input to the output of that
function, and submit the form to the server.

At the server you can perform an insert or update to your database and store
the whole string in a single column. If you later want to query the
document, you can retrieve the string and using the server-side programming
objects available to you, create an XML document object from the string and
query it with XPath.

-- 
Charles Knell
cknell@xxxxxxxxxx - email


 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
Keywords