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

Add node to XML file


I am using VB2005 Beta 2

I want to open a .xml file, test if a certain field exists, if not add the
field to each of the records in the file using a default value.

Thanks for any help,

Thomas

example:

each element looks like this at present
<Filters>
<Type>SAF</Type>
<DbLow>-50</DbLow>
<DbHigh>-24</DbHigh>
<VelLow>600</VelLow>
<VelHigh>2000</VelHigh>
</Filters>

I want to add the bottom two to each element
<Filters>
<Type>SAF</Type>
<DbLow>-50</DbLow>
<DbHigh>-24</DbHigh>
<VelLow>600</VelLow>
<VelHigh>2000</VelHigh>
<MinRange>0</MinRange>
<MaxRange>0</MaxRange>
</Filters>
I need to modify the schema at the top of the file also

Before:
<xs:element name="DbLow" type="xs:int" minOccurs="0" />
<xs:element name="DbHigh" type="xs:int" minOccurs="0" />
<xs:element name="VelLow" type="xs:int" minOccurs="0" />
<xs:element name="VelHigh" type="xs:int" minOccurs="0" />

After:
<xs:element name="DbLow" type="xs:int" minOccurs="0" />
<xs:element name="DbHigh" type="xs:int" minOccurs="0" />
<xs:element name="VelLow" type="xs:int" minOccurs="0" />
<xs:element name="VelHigh" type="xs:int" minOccurs="0" />
<xs:element name="MinRange" type="xs:int" minOccurs="0" />
<xs:element name="MaxRange" type="xs:int" minOccurs="0" />

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Nov 21 '05 #1
0 845

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

Similar topics

2
by: Piet | last post by:
Hi there, I have managed to write a small java program that display an xml file in a JTree. This was achieved by defining a suitable tree model. THe program works...somehow. The nodes (elements...
1
by: Steve Lamb | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ok, this one has me scratching my head. Right now my application is working fine. I have a tree control which contains a 2-level deep tree. The...
10
by: Fabio | last post by:
Hi everyone, Is there anybody who can suggest me a link where I can find information about 'Persistent linked list' ? I need to implement a linked list where every node is a structure like the...
5
by: reddy | last post by:
I am trying to insert a node into an XMLFile. using XMLTextwriter. My Question is Is it possible to do without using XMLDocument. Because its loading all the the file into memory. I just want to...
2
by: Keith M | last post by:
Hi, I have found a very useful piece of code in the msdn which shows how to load an xml config file, search for a particular value and replace it. Could someone possibly convert it to C# from...
3
by: Robert Kane | last post by:
Good afternoon, I'm trying to set up a clustered DB2 v7.1 database on Redhat Linux 7.3. I've followed the instructions (as far as I know) in the accompanying documentation to set up the database...
5
by: jhullu | last post by:
Hi all can I update a xml node AND write the new value in a file witout re-write all the file ? sample : my xml file : <sample>
6
by: Armel Asselin | last post by:
Hello, I'm searching for a simple command line tool to manipulate XML files. The idea would be commands such as that: xmanip-tool set /document/xpath/@name="value" remove //wrong-nodes add...
6
by: Derek Hart | last post by:
I bring in an xml file into vb.net by using xmlDoc.LoadXml(XMLString) - I run xpath statements against the xml file to grab data from it, so I use, as an example, //Vehicles/Vehicles/@make to get...
3
by: Kane | last post by:
When you create node 1 you allocate memory and link it Again when you create node 2 you would allocate memory for that node in a different section of the code. Is there more efficient way where I...
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:
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...
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
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...
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...

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.