The end result is that an HTML form containing the values from the XML file will be displayed for editing.
The reason that I take the "id" attribute from the "field" element in the XML file and place it in the "name" and "id" attributes of the HTML text fields in the XSL file is to reduce confusion and to promote naming consistency.
This example assumes that you are familiar with ASP, XML and HTML 4.0.
This article is a follow up to the Saving HTML Form Data to XML article.
We can use the same technique here to transform the XML file.
Lets take a look at the XML and XSL files that will be used.
We will also apply the edits to the XML file on the server.
Starting from the root element, the "id" attribute for each XML "field" element is written to the "id" and "name" attributes of an HTML text field.
Also, the value of each "field_value" element from the XML file is written to the "value" attribute of each of the HTML text fields.
Using XSL it is possible to open the XML file that you want to edit and transform it into an HTML form and send it to the browser.
The values of the XML elements will be placed as the values of the HTML input fields.