473,396 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do I append and modify an XML file on-line?

Hi,

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?

Please help. Thanking you.
Jul 20 '05 #1
2 6460


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/

Jul 20 '05 #2
You can do it by using XMLHTTP post from JSCript on cleitn side and tiny
engine written, say, on ASP for server side which will just accept incoming
data post and store it back into your xml data file. There is the way to use
XMLDSO, but can't say is it works for saving data back on server, probably
should, but never tryed it actually.

Cheers,
<spider/>

"Veeven" <ch*********@yahoo.co.in> wrote in message
news:b3**************************@posting.google.c om...
: Hi,
:
: 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?
:
: Please help. Thanking you.
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: V.Boomessh | last post by:
Hai All I am developing a VB application in .NET. I read a encrypted text file which contains details of SQL Server name, SQL DBName etc... for DB Connection and i prepare a connection string...
10
by: Rich Wallace | last post by:
I'm sure there's a very weasy way to do this, I've been running hard and fast on several things at once and just may be at the point of overthinking this... I receive an incoming XML document...
2
by: Paul Wagstaff | last post by:
Hi there I have 2 tables: tblAccuracy & tblClearance Users add new records to tblAccuracy using frmRegister. Under specific conditions I need to append the current record from frmRegister into...
2
by: Eranga | last post by:
I want to append text to element3 and element 4 of a .xml file as following. The values in first two elements should not be altered and only the last 2 sholud be changed. <root>...
5
by: Simone M | last post by:
Here is my problem: I need to append a string to a file every time the user downloads this file. The string is different for every user. I would like to append the string to the file via ftp. But...
10
by: pythonnoob | last post by:
Hello everyone. New to python as well as this forum, but i must say ive learned a but already reading through some posts. Seems to be a pretty helpful community here. Before i post a question...
2
by: kvnil | last post by:
Cheers, I've been struggling all day today with this, maybe you could give me some useful pointers. I would like to (elegantly) concatenate a string out of all node values in a map. I have to...
3
by: hikosj | last post by:
Hi all, I have a problem with a query in access that I cant seem to figure out. I have a form named frmRecruitment with a subform named sfrmParticipant. At the moment I am using an append query to...
1
by: sparks | last post by:
We have 3 databases that are just copies of the master. I have no idea why this is but I need to put them all in one. They contain a main table and 2 subtables linked one to many. I am sure that...
42
by: Armin | last post by:
Hi, just a dumb question. Let a = Why is the value of a.append(7) equal None and not ?? --Armin
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.