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

Update attributes in existing XML document

Hi Everyone

I was wondering if anyone could help me out with fairly
straightforwards problem I have.

I have an XML document (in a namespace) and I would like to loop around
one level of the child nodes, and insert a new value to each node. It
needs to be fairly efficient too.

I guess this isn't too difficult to do, but I haven't got a clue how to
do it!

Many thanks in advance

Daz

Example:

<chairs>
<chair id="1" type="1">
<chair id="2" type="1">
</chairs>

To:

<chairs>
<chair id="1" type="1" newvalue="x">
<chair id="2" type="1" newvalue="y">
</chairs>

Jul 19 '06 #1
1 1224
daz_oldham <Da**************@gmail.comwrote:
Hi Everyone

I [wanna change]:

<chairs>
<chair id="1" type="1">
<chair id="2" type="1">
</chairs>

To:

<chairs>
<chair id="1" type="1" newvalue="x">
<chair id="2" type="1" newvalue="y">
</chairs>
Have a look at XSLT. It is well suited for such transformations.
Jul 20 '06 #2

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

Similar topics

10
by: Michael Schuerig | last post by:
I would like to define additional attributes on some XHTML elements. The purpose is to use them as parameters for scripts. So far, I have no good grasp on how to add attributes *cleanly*. Of...
2
by: Richard Cornford | last post by:
Anyone who has taken a look at the online FAQ today may have noticed that I have updated it. The majority of the changes are the updating of broken links and the implementation of that extensive...
3
by: Rich Wallace | last post by:
Hi all, I've been though many posts in this group and have yet to find one that helps me understand how to accomplish my goal. I have an XML document that stores user specific values that I...
8
by: yinjennytam | last post by:
Hi all, I'm new to .NET and XML and I have a question. Given an XML file, I want to navigate its content and look for one or two particular elements to get their values. At this point, it...
1
by: CSharpguy | last post by:
I have a page thats going to be impacted on the IE security update in June, for active x controls, so here is my issue: I have a windows user control on my page that talks to a EXE and works fine....
11
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or...
6
by: | last post by:
Hi, I'm steel trying to read and update my XML file with Visual Basic Express but i am unable to find the right way to read my xml file and update it if neccessary... Here is my problem :...
5
by: handoyo | last post by:
Hi all,i'm trying to show updated data in existing html td.. For example i got column that show last modified datetime,then i want to update data again,the column will changed to current time without...
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...
1
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.