473,734 Members | 2,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XMLDataDocument question-- appending/removing nodes

Hi,

I'm porting a VB 6 app to .Net, and wanted to use an XMLDataDocument to
store information that had previously been kept in XML Recordsets.

Unfortunately, I'm not too familiar yet with .Net's XML Namespace and
was wondering if someone could help with something....in the VB 6
application, we would append two extra nodes to the XMLRecordset-- an error
message, and error number. Then, when it came time to reconstruct the
recordset we'd remove those nodes and go to it.

I'd like to do the same thing in .Net, but I'm not sure how to append
new nodes to existing XMLDataDocument s, nor how to search for and remove the
two nodes when the time comes. I've been reading over the msdn docs but was
hoping someone could point me in the right direction, or even paste a little
code on how to create and append nodes to an XMLDataDocument , and how to
search for particular nodes and remove them? Thanks very much.

-Jim
Nov 12 '05 #1
1 2088
There are at least a couple of ways. You can use the XML DOM methods, such
as InsertAfter:

objDoc.InsertAf ter(objInserted Node, objExistingNode )

or you can just set the InnerXml property of a node:

objNode.InnerXm l = "<LongCode> " & strNewValue & "</LongCode><Short Code>" _
& strShortCode & "</ShortCode>"

This example demonstrates both techniques:
http://www.daveandal.net/books/8900/.../edit-xml.aspx
Nov 12 '05 #2

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

Similar topics

12
1837
by: Ole Noerskov | last post by:
The function below is supposed to remove all childnodes with a name that starts with "keywords" in "myform" in the window.opener. It works fine if there's one keyword node. But you have to run the function several times if there are many keyword nodes. Why? function removeKeywords() { var form_obj = window.opener.document.getElementById('myform');
3
16039
by: e-mid | last post by:
Here is an xml structure. i want to remove <a> nodes that do not have any child. How can i do that in csharp? <root> <a> <b/> </a> <a/> <a/> <a> <c/>
1
1659
by: Swanand Mokashi | last post by:
Ok here is my XML structure : <Files> <File Name="One.txt"> <Client Name="test1"> <Errors> <OtherErrorIDs> <OtherErrorID>1</OtherErrorID> <OtherErrorID>2</OtherErrorID> <OtherErrorID>4</OtherErrorID> </OtherErrorIDs>
2
10700
by: Greg | last post by:
Hi. I have a rather large xml document (object) that can have one or more nodes with a certain attribute throughout (at ANY depth, not at the same level necessarily). I need to find this attribute and remove the containing node (and child nodes) if it has a certain value. I'm able to find the attributes using an XmlTextReader. Once found, can someone help me get the XPath at that point? I would then use this to remove the node from...
3
1626
by: hharry | last post by:
Hi All, If I have the following xml: <Response> <AddressDetails> <Address> </Address> </AddressDetails> </Response>
17
2717
by: Eric_Dexter | last post by:
def simplecsdtoorc(filename): file = open(filename,"r") alllines = file.read_until("</CsInstruments>") pattern1 = re.compile("</") orcfilename = filename + "orc" for line in alllines: if not pattern1 print >>orcfilename, line I am pretty sure my code isn't close to what I want. I need to be able
2
3020
by: runway27 | last post by:
my question is about removing the borders that are displayed by a select tag. presently i have a select tag that displays 8 values to which i have given a size of 5. code for this is = <select name="firstselect" size="5" class="select" style="width:219px;"> <option> </option> </select> the table in which this select tag is placed is as follows = <TABLE style="BORDER-RIGHT: 1px solid; BORDER-TOP: 0px; BORDER-LEFT: 1px solid;...
0
8946
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
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9236
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9182
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...
1
6735
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
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
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.