By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,866 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,866 IT Pros & Developers. It's quick & easy.

Appending a Node

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.