Click here to Skip to main content
15,919,613 members
Home / Discussions / C#
   

C#

 
GeneralRe: XML message generation Pin
George_George7-May-08 23:48
George_George7-May-08 23:48 
GeneralRe: XML message generation Pin
N a v a n e e t h7-May-08 23:55
N a v a n e e t h7-May-08 23:55 
GeneralRe: XML message generation Pin
George_George7-May-08 23:57
George_George7-May-08 23:57 
GeneralRe: XML message generation Pin
N a v a n e e t h8-May-08 0:09
N a v a n e e t h8-May-08 0:09 
GeneralRe: XML message generation Pin
George_George8-May-08 2:59
George_George8-May-08 2:59 
GeneralRe: XML message generation Pin
N a v a n e e t h8-May-08 3:14
N a v a n e e t h8-May-08 3:14 
GeneralRe: XML message generation Pin
George_George8-May-08 3:22
George_George8-May-08 3:22 
GeneralRe: XML message generation Pin
N a v a n e e t h8-May-08 3:33
N a v a n e e t h8-May-08 3:33 
George_George wrote:
So, can I understand that using XMLDocument has better performance compared with XMLTextReader, but bigger memory footprint.


This depends on the XML file size. When you call Load() method in an XMLDocument classes instance, it reads all the nodes and forms a DOM and keeps in the memory. So when the file is huge, it will consume more memory.

Performance is dependent of your scenario. If you need to read the XMLFile (not as DOM), XMLTextReader will give good performance. For creating a new xml file, XMLTextWriter will give good performance. Say, in a situation where you will add new nodes, change the attributes, and doing some XPath queries, then better choice would be XMLDocument class.

George_George wrote:
XMLDocument can both read/write, but XMLTextReader can only read, and XMLTextWriter can only write?


XMLDocument class can do more than read/write. It supports XPath queries also.

All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia

How to use google | Ask smart questions

GeneralRe: XML message generation Pin
George_George8-May-08 3:44
George_George8-May-08 3:44 
GeneralRe: XML message generation Pin
N a v a n e e t h8-May-08 4:05
N a v a n e e t h8-May-08 4:05 
GeneralRe: XML message generation Pin
George_George8-May-08 4:20
George_George8-May-08 4:20 
AnswerRe: XML message generation Pin
N a v a n e e t h7-May-08 23:50
N a v a n e e t h7-May-08 23:50 
GeneralRe: XML message generation Pin
George_George7-May-08 23:55
George_George7-May-08 23:55 
AnswerRe: XML message generation Pin
vytheese8-May-08 0:39
professionalvytheese8-May-08 0:39 
GeneralRe: XML message generation Pin
George_George8-May-08 3:00
George_George8-May-08 3:00 
GeneralRe: XML message generation Pin
vytheese8-May-08 18:11
professionalvytheese8-May-08 18:11 
GeneralRe: XML message generation Pin
George_George8-May-08 22:01
George_George8-May-08 22:01 
Questionvalue type inheritance Pin
George_George7-May-08 23:10
George_George7-May-08 23:10 
AnswerRe: value type inheritance Pin
Roger Alsing7-May-08 23:59
Roger Alsing7-May-08 23:59 
GeneralRe: value type inheritance Pin
George_George8-May-08 0:04
George_George8-May-08 0:04 
GeneralRe: value type inheritance Pin
CPallini8-May-08 0:40
mveCPallini8-May-08 0:40 
GeneralRe: value type inheritance Pin
George_George8-May-08 3:04
George_George8-May-08 3:04 
GeneralRe: value type inheritance Pin
CPallini8-May-08 3:14
mveCPallini8-May-08 3:14 
GeneralRe: value type inheritance Pin
George_George8-May-08 3:32
George_George8-May-08 3:32 
GeneralRe: value type inheritance Pin
N a v a n e e t h8-May-08 3:41
N a v a n e e t h8-May-08 3:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.