473,405 Members | 2,171 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,405 software developers and data experts.

Appending a Node

I have below a sample parent-child xml that I'm trying to
manipulate

<Persons>
<Person Id='1'/>
</Persons>
I will have a string that I want to append to my existing
xml shown below:
"<Person Id='1'/>"

My question is, instead of creating a new node using the
createnode method of the xml document, I want to append
the string that I have to the xml. I noticed that there
is a "createtextnode" method but it doesn't do what I
need it to do. How can I create an element node with the
string that I have, because by using the "createnode"
method, I have to specify a name, etc..
Thanks,
Nov 11 '05 #1
1 1835
Johnny wrote:
I have below a sample parent-child xml that I'm trying to
manipulate

<Persons>
<Person Id='1'/>
</Persons>
I will have a string that I want to append to my existing
xml shown below:
"<Person Id='1'/>"

My question is, instead of creating a new node using the
createnode method of the xml document, I want to append
the string that I have to the xml. I noticed that there
is a "createtextnode" method but it doesn't do what I
need it to do. How can I create an element node with the
string that I have, because by using the "createnode"
method, I have to specify a name, etc..


Seems like you are talking about InnerXml property. You can get InnerXml
property of Persons element, append your string and set is back - it'll be
parsed and all necessary nodes will be created. Beware, it involves parsing,
so make sure you are keeping wellformdness.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2

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

Similar topics

3
by: Kleist | last post by:
Hello, I use DOM XML PHP functions to build a document. Is it possible to insert a new node as sibling right after the selected by xpath node? There is a function insert_before() but it seems...
1
by: Novice | last post by:
Hey all, I've read a few articles about speed and XML processing - so I just want to make sure that I'm using the right strategy for what I want to achieve. I have an XML file that I'm appending...
1
by: Jonathan Taylor | last post by:
I have a large XML file, that is too large to read in to XmlDocument. I need to append data to this XML file without creating a new file, since I don't want to have two copies of the large file...
17
by: Grant Austin | last post by:
I have a linked list where each node holds a couple numbers a char and a const char array. I use strcpy to take an char array argument passed to my insert function to copy the string into the new...
4
by: Jesper Stocholm | last post by:
I have a database class that maintains data about customers i my system. The basic XML for this looks like: <Chunk> <Vendor> <Database/> </Vendor> </Chunk> When a user is to be registrered...
2
by: tony.collings | last post by:
I started a thread here : http://groups.google.co.uk/group/microsoft.public.cmserver.general/browse_thread/thread/29d63077144004a9/c3888efdcb7338f6?hl=en#c3888efdcb7338f6 About creating an Email...
2
by: Shaurya Vardhan | last post by:
Hi, On Appending a child in XML Node, I am having error, "Run-time exception thrown : System.ArgumentException - The node to be inserted is from a different document context." How to resolve...
1
by: luthriaajay | last post by:
I have a tricky question here. 1).I have an XML that is generated on the fly. XML Generated ------------- Document genereatedDoc =
0
by: ghafarifar | last post by:
How I appending a new node to am existing xml file? help?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
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...

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.