473,698 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

appending elements to existing xml

hi guys...

I hav this problem, I am planning to write html form values to xml file
and... the problem is...
When I am entering data... its recording only the latest entry.. by
overwriting the existing entry.. so at any given time there's only one
element in the xml file...

I repeat my self... Everytime a new entry is added, the already
existing xml file is being overwritten and only the latest element is
recorded...

Please help me out...

regs

Nov 21 '05 #1
1 1413
You need to add the element instead of setting the existing element's
properties.
To append an element to a XmlNode called "theNode":
XmlElement element =
theNode.OwnderD ocument.CreateE lement("element Name");
element.InnerTe xt = "Some text";
element.SetAttr ubute("someAttr ibuteName", "someAttrValue" );
theNode.AppendC hild(element);

Thi

Nov 23 '05 #2

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

Similar topics

6
2267
by: Fnark! | last post by:
I am creating a shopping cart using PHP Version 4.1.2. I am creating and registering a cart object in a session. The cart object contains an array of arrays called $order whose elements are a collection of $orderline associative arrays which, in turn, hold the global POST values key 'order_code' and value 'qty' as passed in from another page. My problem is (shown by using print_r to print out the contents of the arrays) each time I...
0
1852
by: Red Ogden | last post by:
I would really appreciate some advice on the best way to do this. The problem is this: I want to create a web form where the user specifies an existing XML file name and a value for attribute on an element. The elements matching this attribute in a second XML file (master) are then appended to the first user specified XML file. Both XML files have similar structure but the second file is a master file with a large number of elements....
1
2019
by: oasd | last post by:
I'm having difficulty appending data. I have an import macro (using the Transferspreadsheet function) to import data from an excel spreadsheet (located in a USB attached to the pc) to an access database. The data in the USB has addtional info to be added to the respective record in the database. The problem is that the data is not appended to the existing record but merely added as an extra record.....effectively giving me a duplicate...
2
3594
by: Cat | last post by:
How do you go about appending data from a dataset to an existing xml file? I know you can use WriteXML but this writes over any data already existing in the specified file.. Cat
3
1681
by: delraydog | last post by:
I'm writing a reusable JavaScript library which needs to set certain styles in a document. The document may have an existing stylesheet definition either by a link or by an existing stylesheet declaration in the documents head section. How can I use JavaScript to append my own style sheet information to a possibly already existing stylesheet definition? Thanks!
1
2297
by: Ron Adam | last post by:
In my program I have a lot of statements that append elements, but sometimes I don't want to append the element so it requres an if statement to check it, and that requires assigning the returned element from a function to a name or calling the funtion twice. e = ET.Element('name') e.append(get_subelement(obj)) # but raises an exception on None
5
5558
by: toton | last post by:
Hi, I want to append one vector after another. so like, vector<intv1; ///put some elements to v2. I have a second vector vector<intv2; ///it has some elements. Now I do v1.reserve(v1.size() + v2.size()) ; and then
1
1472
by: ofuuzo1 | last post by:
Hei, I am having issue using DOM to appending a new xml file (new.xml) to another existing xml file (old.xml) without deleting the existing items in old.xml. I would like to have the new <itemsappend at the end of existing items at the old.xml. How can I do that? I am using php5 Thanks! Ofuuzo
1
3784
by: ofuuzo1 | last post by:
Hi, Is there anyway I can append a new element to an existing xml without first loading the existing file into a variable, adding the new element into the variable and saving it by overwriting the existing file name? Thanks Ofuuzo
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9157
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9023
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8861
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7721
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.