computer dating uk - Updating an xml file

After you make the necessary edits, the edited information can be submitted to the server and the XML file updated.

The second is update XML which applys the edits to the XML file.'----------------------------------------------------------- 'The "load XMLFile" Function accepts two parameters.

'str XMLFile - The path and file name of the XML file.

'-----------------------------------------------------------'Set obj Field variable equal to a field_value element by 'calling the select Single Node method of the obj Root '(document Element) object.

The Select Single Node method 'accepts a string parameter for querying the XML document.

'In this case, the current value of the key property of 'the Form Collection is used to find the appropriate 'field_value element (more on this later).'Call the load XMLFile method, passing in the newly edited 'XML file and the style sheet. Form(x) End If Next This is the code that does all the work of updating the XML file. This method queries the XML file for a single node that matches the query that is passed into the function.

This will 'allow the client to see the edited information. As you can see, it is the ASP file that handles the entire process of updating the XML file. In this case, the query is “field[@id='”& key(x) & “‘]/field_value”.

If the form is being submitted, the XML file is opened and updated. Key(x),"btn") = 0 Then Set obj Field = obj Root.select Single Node("field[@id='" & _ Request. What this query is requesting is the field_value element that is the child of a field element that has an id attribute which matches the current key value in the Form Collection.

If the form is not being submitted, then the XML file is loaded and tranformed by into an HTML form so that the user can edit it. Once the proper node is obtained, then it is just a matter of updating the text property to match the value of the current field in the Form Collection.

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.

The XSL file will transform the XML for display in the browser.

Comments are closed.