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

what is the best way to do this (replacing xmlnode value)

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 that i want but i need to
change some xml node value before i insert. what is the best way to do this?
Aug 22 '06 #1
1 1241


dotnetnoob wrote:
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 that i want but i need to
change some xml node value before i insert. what is the best way to do this?
Well if you use importNode to import a node from a different document
then that node the importNode method returns can be manipulated like any
DOM node so you can remove child or descendant nodes or can insert new
child nodes, you can add and remove attributes, you can change the order
of node. Of course all that requires knowledge and use of the DOM API to
create, insert or remove nodes (and maybe XPath to find nodes).

Depending on your needs and your skills an XSLT stylesheet might also be
a tool to do the job, in some cases certainly more elegantly than DOM code.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Aug 23 '06 #2

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

Similar topics

1
by: Giuseppe | last post by:
Hello I have created a xml doc Dim xmlDoc As New XmlDocument xmlDoc.Load(ConfigurationSettings.AppSettings("RegistrazioneErroriXML")) The file.xml: <?xml version="1.0" standalone="yes" ?>...
11
by: Ray5531 | last post by:
what is the equivalent of this in C# ? foreach (XmlNode xmlConfigNode in xmlConfigDoc.ChildNodes) Thansk
2
by: Scott M. Lyon | last post by:
I'm trying to figure out the best way (considering there could be instances where I get a lot of data in this XML, and I want to minimize any slowdowns) to extract the value of one particular node...
2
by: Jens Jensen | last post by:
Hello, I'm calling a webservice that returns data packed in an xml file.( System.Xml.XmlNode) I wrote the webservice myself. But users are not very experienced with xml. I'm therefore tempted...
3
by: Earl | last post by:
In VB.Net, the following declaration builds and executes with no exceptions: Dim XMLDoc As New XmlDocument Dim Node As XmlNode But in C#, the following (equivalent?!) returns the build error...
2
by: NS | last post by:
Hello, I'm new to xml and I have a question: I try to do the following Dim doc As New XmlDocument doc.LoadXml("<Request><Root><Requestor name='' /><FlowData flowstatus=''...
5
by: Steve Harclerode | last post by:
I saw something in the Microsoft documentation for SelectNodes() that I've never noticed before today: ----- Return Value The first XmlNode that matches the XPath query or a null reference...
0
by: seasonmmclane | last post by:
I am clueless... Here is my code: Private Sub genCodeDynamic(ByVal nIn As XmlNode, ByRef nOut As XmlNode, ByVal docOut As XmlDocument, _ ByVal stopAtNode As XmlNode, ByVal dr As DataRow) ...
4
by: CSharper | last post by:
I am reading an XmlFile using XmlDocument and traverse through the XmlNode, as I read I need to append an attribute to the XmlNode on some conditions. I tried xmlNode.Attributes.Append() It...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.