Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Your recommendation needed, please!

Status
Not open for further replies.

greedyzebra

Technical User
Sep 5, 2001
140
0
0
US
Hi,

I'm working on a project where an XML file is being used to transfer data from one application to another. We want to have an empty template for this file that users can edit (populate the data).

However, we don't want the users editing the xml. Can anyone recommend an editor that would present only an element and, say, an empty box for its value?

Ideally I would like to simply create an xml page that could be viewed in a web browser, take input, then save the "modified" file to the file system, but I don't think that's possible.

Any suggestions are helpful and welcome!
 
Sure that's possible. Create an XSLT that creates a standard HTML data entry form when viewed. The users browse to the XML, which runs the XSLT, users see an HTML Form, which they fill out and submit.

Server-side, you process the form results back to XML.



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
Thomas,

Thanks very much for the info. I figured there would be a way to do it server side. However, I need the edited file (form input would be fine) to be handled on the user's computer. If there was a way for the doc containing the form input (either html or xml) to send the form data to a program on the pc that could hanlde it, that would be great. But I don't think that's possible.

Your idea about doing this server side, though, has given me some other ideas... Thanks again!
 
Have you looked at Office 2003 and One Note? They give your users the ability to fill out forms that are really XML files.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
If you have ActiveX and JavaScript at your disposal, you can use JavaScript to read the form and write to a variable all the XML with the values filled in:

e.g.,

var xmlString = "<field1><subfield1>"+document.formname.fieldname.value+"</subfield1><subfield2>"+...

Then, use ActiveX to save the file. This will be on the client side though (which seems to be what you want):

Code:
var myFilePathAndName = myFilePath + "/" + myFileName; //assuming you have values for these
var myfile = new ActiveXObject("Scripting.FileSystemObject");
var a = myfile.CreateTextFile(myFilePathAndName, true);
a.WriteLine(xmlString);
a.Close();

I haven't used this in a while, but if you replaced myFilePathAndName with myFileName, I'm relatively certain it would just save the file to the same directory as the code.

'hope this helps.

--Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top