Veeven wrote:
Suppose I have an XML file like this on the web, say,
http://www.example.com/list.xml
<?xml version='1.0'?>
<list>
<item id='itm01'>
<name>Item 1</name>
<desc>This is item 1</desc>
</item>
<item id='itm02'>
<name>Item 2</name>
<desc>This is item 2</desc>
</item>
<!-- many more... -->
</list>
I want to add a new item to the list or modify an existing item. Is
there any way (like I fill out a form and list.xml is updated) either
using ASP, PHP or Perl?
Well, current browser support HTML 4 which has form controls like <input
type="text"> which will allow you to build a form where someone can
enter the name and desc of a new item and submit the data to a server
where a PHP or ASP or Perl script could then add the item to your XML file.
Browsers like IE5+/Win and Netscape 6+ respectively Mozilla also have
script support to build XML documents in memory using the W3C DOM and
post such an XML document serialized to a server, ASP can easily read
such a posted XML, PHP is in my experience not that good at reading a
posted file (although I think since 4.3.0 it is better supported), with
Perl CGI scripting I am not too familiar to judge its facilities here.
HTML forms have no support for binding/posting XML directly, there are
two suggestions for new forms that support that, one is XForms from the
W3C, see
http://www.w3.org/MarkUp/Forms/
which has some implementations, and the other is Web Forms, see
http://www.hixie.ch/specs/html/forms/web-forms
which is as far as I know not implemented anywhere (being just a draft)
but written by an Opera employee so it seems it has chances to be
implemented some day.
--
Martin Honnen
http://JavaScript.FAQTs.com/