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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving form data to XML-file while preserving the order of elements

Status
Not open for further replies.

comma

Programmer
Feb 12, 2003
24
FI
Hi,

I'm quite new to CGI and currently learning it. I would be interested on how the following issue would be possible to handle with web form.

If I have for example a following type of contents in an XML -file:

<sequence>
<step>
<execute>backup files</execute>
</step>
<step>
<execute>do cleanup</execute>
</step>
...
more content
...

</sequence>

The contents of a file is just an example file containing e.g. sequences in that form.

This file is shown as a xHTML form with XSL conversion and the execute -parameters can be modified through the web-based form.

Do you know any examples on how to save the form data so that the order of the elements would remain the same? I have currentely used Perl module XML::Simple for saving the data from the form back to XML-file.

The problem in XML::Simple is that it does not preserve the order of the hash -elements, so it's not very suitable for that. Of course the data got from the form can be saved in right order with Tie::IxHash, but unfortunately XML::Simple doesn't support it (at least not yet).

It would be interesting to know if it's possible to save the data back to XML -file so that the order of the elements remain the same (only data between <execute> -tags
is changed). Recommendations for good web-pages explaining the issue would be great (or maybe even modules that could handle that).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top