RE: Input Fields in XML

Subject: RE: Input Fields in XML
From: Gabriel Paiz III <gpaiz@xxxxxxxxx>
Date: Wed, 2 Dec 1998 10:09:31 -0800
Bernd.Loepmeier@xxxxxx writes:

> In the field I type "Bernd" and click the button.
> 
> After klicking on the button I want to get a xml-file:
> 
> <?xml version="1.0"?>
> <Root>
> <Name>Bernd</Name>
> </Root>
> 
> Are there any demo pages in the Web?

How about a DOM version? Here's a script that will generate your XML
file in IE5b2.  Right now, it writes the result to the document,
replacing it in the browser:

<HTML>
<HEAD>
     <TITLE>Input</TITLE>
</HEAD>
<SCRIPT LANGUAGE="JAVASCRIPT">
function Create_onClick()
{
    var doc = new ActiveXObject("Microsoft.XMLDOM");
    var nodProlog = doc.createProcessingInstruction("xml",
"version='1.0'");
    doc.appendChild( nodProlog);
    var nodRoot = doc.createElement("Root");
    doc.appendChild( nodRoot);
    var nodName = doc.createElement("Name");
    nodName.appendChild(doc.createTextNode(txtName.value));
    nodRoot.appendChild(nodName);
    document.write(doc.xml);
}
</SCRIPT>

<BODY>
Name:<input type="text" id="txtName" size="20"/><BR>
<input type="Button" id="cmdCreate" onclick="Create_onClick()"
value="Press here to create XML file"/>
</BODY>
</HTML>

__________________________________
SPX - Valley Forge T.I.S.
25691 Atlantic Ocean Drive Suite B-7
Lake Forest, CA 92630
USA    www.vftis.com
__________________________________

Tel:	(949) 460 0094
Fax:	(949) 460 0095
e-Mail:	gpaiz@xxxxxxxxx
__________________________________


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


Current Thread