473,320 Members | 1,977 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.

Possible to edit and save back certain nodes ONLY of an xmlDocument?

One more question...please.

I have an xml doc like this:

<assembly>
<station name="station1">
<wi id="1" name="doc231">
<boards>
<board sn="1111" start="07/15/03" end="07/16/03" />
<board sn="1112" start="07/15/03" end="07/16/03" />
</boards>
</wi>
<wi id="2" name="doc555">
<boards>
<board sn="1113" start="07/15/03" end="07/16/03" />
<board sn="1114" start="07/15/03" end="07/16/03" />
</boards>
</wi>
</station>
</assembly>

There are many <station> elements in the doc. This doc is saved as a
doc, not in a database.

Is it possible to have a user just edit one <station> and its
children/attributes then save those nodes back...can't picture
how...but I was hoping it was somehow possible...it is a doc that will
have access by multiple users and trying to figure out how to save all
the data.

Thanks,

Kathy
Nov 11 '05 #1
2 1482
yes, an application can modify just one of the elements in an xml doc, and
then save that to a file.

BUT, this will not work nicely if you are planning to have concurrent access
to the file. Example:
user1 starts app, loads XML file
user2 starts app, loads XML file
user1 modifies "station1" element
user2 modifies "station2" element
user1 saves file
user2 saves file

Then what will be in the file on the disk? Only the changes from user2. A
database can handle this sort of concurrent access. You can also do
something similar in a file but it takes some extra planning and coding.

How many users are involved? You might consider going to a database - it's
not that complicated and it's very nice for concurrent access.
And with MSDE, the license is free.

"KathyB" <Ka**********@attbi.com> wrote in message
news:75**************************@posting.google.c om...
One more question...please.

I have an xml doc like this:

<assembly>
<station name="station1">
<wi id="1" name="doc231">
<boards>
<board sn="1111" start="07/15/03" end="07/16/03" />
<board sn="1112" start="07/15/03" end="07/16/03" />
</boards>
</wi>
<wi id="2" name="doc555">
<boards>
<board sn="1113" start="07/15/03" end="07/16/03" />
<board sn="1114" start="07/15/03" end="07/16/03" />
</boards>
</wi>
</station>
</assembly>

There are many <station> elements in the doc. This doc is saved as a
doc, not in a database.

Is it possible to have a user just edit one <station> and its
children/attributes then save those nodes back...can't picture
how...but I was hoping it was somehow possible...it is a doc that will
have access by multiple users and trying to figure out how to save all
the data.

Thanks,

Kathy

Nov 11 '05 #2
Thanks. I "mispoke" a bit. The xml tree IS in a database but in a string
in one field. So I can have a user READ the xml, manipulate his/her
"station" information, then retrieve the "current" string from the db,
make the revisions to the nodes, then save. Only one user should be
changing any given station at one time.

Given that, would you have an example/explanation of how to save back
(overwrite) an entire <station> element including all attributes and
children, etc.? I know how to get the individul nodes with xpath, etc.

versus saving the entire xml string back (because that would do as you
said...be missing information.

thanks again,

kathy

Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 11 '05 #3

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

Similar topics

2
by: Donal McWeeney | last post by:
Hi, I think I may have a slight encoding problem with what I am doing. I have a test console app that takes an xml document and splits it into a number of smaller xml documents. First thing...
1
by: Roger | last post by:
I need to edit the IIS 6.0 config file (metabase.xml) and had a go with this code, trying to get a list of all defined websites, and write their name to console, but it does not seem to work, would...
4
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml...
3
by: Stefano | last post by:
I've a form windows with a lot of textbox controls. How can I do if I have to save all text proprety of this controls in an external file, to reload them in future?
4
by: andersch | last post by:
Hi I display a xml file with the TreeView control (Windows Forms) on my MainForm. Now, I would like to be able to edit this xml file (XmlElements) when I select a node in this TreeView. For...
2
by: Gina_Marano | last post by:
Hey All, I need to edit an existing XML file and save it. It seem pretty easy and straight forward but it fails because (I assume) the xml document lists a schema location that I do not have...
1
by: BiT | last post by:
Hello I Know how to create and add elements to xml file with XmlTextWriter, here is code for example: Dim textWriter As XmlTextWriter = New XmlTextWriter("table.xml", Nothing) ' Opens the...
4
by: gator | last post by:
Hello, I am trying to edit a specific node in an XML file using C#. I have searched around for example code to do this. The only solutions I have come across either add a new node to the doc...
12
by: minimalniemand | last post by:
I try to recursivley fill a treeview from a xml-file. It works well, when the contents of the xml and the treeview match 1:1. code here: http://mad-scientists.co.uk/micha/shownode.txt a sample...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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...
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
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...

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.