473,385 Members | 1,593 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,385 software developers and data experts.

replacing nodes

Hi all,
Following in a portion of an xml document. I would like to replace
"nso:Proposal" node with its child "w:p" node programmatically. How can I do
this?
Thanks.

<ns0:Proposal>
<ns0:Company>
<w:p>
<w:r>
<w:t>test company</w:t>
</w:r>
</w:p>
</ns0:Company>
</ns0:Proposal>
Nov 12 '05 #1
2 3395
If you have loaded the XML into an XmlDocument object and if you have found
the ns0:Proposal element, let's call it "XmlElement e", then you could do
the following:

e.ParentNode.ReplaceChild(e.FirstChild, e);

"Nikhil Patel" <ni********@aol.com> wrote in message
news:eJ**************@TK2MSFTNGP09.phx.gbl...
Hi all,
Following in a portion of an xml document. I would like to replace
"nso:Proposal" node with its child "w:p" node programmatically. How can I do this?
Thanks.

<ns0:Proposal>
<ns0:Company>
<w:p>
<w:r>
<w:t>test company</w:t>
</w:r>
</w:p>
</ns0:Company>
</ns0:Proposal>

Nov 12 '05 #2
If you have loaded the XML into an XmlDocument object and if you have found
the ns0:Proposal element, let's call it "XmlElement e", then you could do
the following:

e.ParentNode.ReplaceChild(e.FirstChild, e);

"Nikhil Patel" <ni********@aol.com> wrote in message
news:eJ**************@TK2MSFTNGP09.phx.gbl...
Hi all,
Following in a portion of an xml document. I would like to replace
"nso:Proposal" node with its child "w:p" node programmatically. How can I do this?
Thanks.

<ns0:Proposal>
<ns0:Company>
<w:p>
<w:r>
<w:t>test company</w:t>
</w:r>
</w:p>
</ns0:Company>
</ns0:Proposal>

Nov 12 '05 #3

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

Similar topics

4
by: Charles Crume | last post by:
Hello all; I have a web page that displays a blank gif for about 2 seconds, then displays an animated gif image, then, after the animation plays, I want to display a link so the user can click...
0
by: Nick Wong | last post by:
I am using a XmlValidatingReader to validate an xml against a xsd schema. What I would like to achieve is to "mark" each invalid node element with an attribute. The resultant xml is then passed...
12
by: anonymous | last post by:
Hello, I need to replace this char  with another char. However I am not able to acieve this. I tried this but it doesnt work: str = str.Replace(chr(asc(194)), "") Can somebody help ?
2
by: André | last post by:
I've started using elementtree and don't understand how to use it to manipulate and replace nodes. I know how to do this using a simple, but inefficient parser I wrote, but I'd rather learn to use...
1
by: dotnetnoob | last post by:
i need to copy several xml files and use it as xml element and insert them into a xml file. i use DOM support in .Net and from the pervious help i was able to copy and insert them into the xml file...
4
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole...
2
by: James Fifth | last post by:
Hello and God Bless, I am stumped trying to get a simple xml database replacing certain data with other data programmatically. This is what my xml looks like. ...
0
by: theFLY | last post by:
Hello there, I have an XML file of structure that looks like this: <?xml version="1.0"?> <documents> <header id="1"> <title></title> <prodGroup></prodGroup> <version> ...
0
by: theFLY | last post by:
This has posted in the ASP sub-forum, to no avail I re-post here. Hello there, I have an XML file of structure that looks like this: <?xml version="1.0"?> <documents> <header...
1
by: TamusJRoyce | last post by:
I have xsl code which I was hoping could be used to replace one specific tag from an xhtml document and output another xhtml document. xsl has phenomenal potential in data replacing, but coming...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.