|
-
Apr 2nd, 2003, 02:55 PM
#1
Thread Starter
Addicted Member
Append/Replace XML section? [resolved]
How can I append or replace a single section within my XML file?
Currently, I am having to save the entire XML file when I make changes to my data. But I would like to be able to reduce the time, by only saving 1 section of the XML file.
I would like to be able to save info to the user settings, without saving the entire user and data items, etc.
PHP Code:
...
<user>
<settings .... />
</user>
<data>
<item ... >
....
</item>
...
</data>
...
Reference: (This is how I am reading/writing XML)
Read XML from a file
Write XML to a file
thanks,
Last edited by Shurijo; Apr 4th, 2003 at 07:29 PM.
-Shurijo
-
Apr 3rd, 2003, 03:33 PM
#2
Thread Starter
Addicted Member
Any ideas if this is even possible?
-
Apr 3rd, 2003, 03:38 PM
#3
I don't think it is, sorry. I have never seen anything that can save or load only part of a file. You can break the xml tables up into seperate files and that would work.
-
Apr 3rd, 2003, 03:47 PM
#4
Sleep mode
From quick glance at this page , it says you can read XML Nodes . I don't know if it's right .
If I were you , I would store all these info in database file !!
I hope that helps !
-
Apr 3rd, 2003, 06:09 PM
#5
Yeah you can change it via nodes or read or write nodes but you will still need to load the xml file into an xmldocument first.
-
Apr 3rd, 2003, 06:12 PM
#6
Thread Starter
Addicted Member
Thanks for the help. I believe that the node reading (in the web page) still requires the app to loop through the document (I am bascially doing the same commands when I read/write the XML file.) I don't think it is possible either, but it seems like something that should .NET should be able to do.
-
Apr 3rd, 2003, 06:18 PM
#7
How are you reading and writing the document now?
-
Apr 3rd, 2003, 07:49 PM
#8
Frenzied Member
Dont gain the world and lose your soul
-
Apr 4th, 2003, 02:22 AM
#9
Sleep mode
Are you talking about Web XML Files ??
-
Apr 4th, 2003, 03:23 AM
#10
Whats the difference between a web xml file and any other xml file? They are all the same.
-
Apr 4th, 2003, 03:25 AM
#11
-
Apr 4th, 2003, 03:41 AM
#12
I guess thats just a matter of opinion. I think using either a Dataset or an XMlDocument objects is the best. I don't like using just text or the XMLTextWriter/Reader that seems like too much work.
-
Apr 4th, 2003, 05:25 AM
#13
Sleep mode
Yes Ed , I agree with you .
-
Apr 4th, 2003, 11:15 AM
#14
Thread Starter
Addicted Member
The XMLdocument looks much better, I just haven't used it before. Looks like that would be better for me to start using instead of the XMLTextReader/Writer.
Thanks all.
-----------
Update: I just changed all my read/write to XMLdocument and it worked great. I was able to just edit a certain section or even a certain element, etc.
-----------
Last edited by Shurijo; Apr 4th, 2003 at 07:30 PM.
-Shurijo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|