Web Development

General discussion


Filling in a Form w/data from a XML

By rheal.dugas ·
Filling in a Form w/data from a XML file
I have a ASP page that contains a form which I want to populate with values from a XML file which I get from a MainFrame server.

I have the code to get the xml file and place it into a Variable that I named "GetStuff"

My problem is extracting the information from the XML and placing it into the form.

This is the code I use to get the information intop a XML file and put it into the "GetStuff" Variable. This code works well for me.
option explicit
Dim Browser,URL,ParseMe
Dim Address
Dim Getstuff
Dim objWinHttp
Set Browser = Server.CreateObject("WinHttp.WinHttpRequest.5")

Browser.Open "GET",URL,False

My XML contains 37 items. I have put in "1's" the fields.
Now I want to be able to get, lets say the information contained in the <ADDRESS>11111</ADDRESS> section and put it into a Form input area on my ASP page using the Variable "Address". I want to be able to do this for almost all the sections in the XML but if I can get one to work I can just duplicate it for the other sections
Here is the code.
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
Get infor from XML and place into the Form:
<form name="form1" method="post" action="">
<input name="textfield2" type="text" value=" <%=Address%>" />
Below is the XML file which is in the variable "GetStuff" that the first part of the code retreived.

<?xml version="1.0"?>
Can anyone Pleae help me with this.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by sjohnson175 In reply to Filling in a Form w/data ...

If you can use ADO in your application you can open the XML into a recordset object and then move through that to get the data you need.


The other open would be to open the XML into the XML Document Object and find the elements and/or attributes you need that way.


Collapse -

by rheal.dugas In reply to

Poster rated this answer.

Collapse -

by rheal.dugas In reply to Filling in a Form w/data ...

This question was closed by the author

Related Discussions

Related Forums