-----Original Message-----
From: "Kathy Burke" <Kathy_Burke(_at_)Jabil(_dot_)com>
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(_at_)onebox(_dot_)com - email
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list