Click here to Skip to main content
15,915,867 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do you read the end of an XML file in C#? Pin
bigove25-Sep-06 5:24
bigove25-Sep-06 5:24 
GeneralRe: How do you read the end of an XML file in C#? Pin
Ed.Poore25-Sep-06 6:13
Ed.Poore25-Sep-06 6:13 
GeneralRe: How do you read the end of an XML file in C#? Pin
Ed.Poore25-Sep-06 6:15
Ed.Poore25-Sep-06 6:15 
GeneralRe: How do you read the end of an XML file in C#? Pin
bigove25-Sep-06 22:13
bigove25-Sep-06 22:13 
GeneralRe: How do you read the end of an XML file in C#? Pin
Ed.Poore25-Sep-06 23:28
Ed.Poore25-Sep-06 23:28 
GeneralRe: How do you read the end of an XML file in C#? Pin
bigove25-Sep-06 23:44
bigove25-Sep-06 23:44 
GeneralRe: How do you read the end of an XML file in C#? Pin
Ed.Poore26-Sep-06 0:03
Ed.Poore26-Sep-06 0:03 
GeneralRe: How do you read the end of an XML file in C#? Pin
bigove26-Sep-06 0:20
bigove26-Sep-06 0:20 
No. It did seem to go through the for-loop a few too may times in a weird way, but still worked 'as expected' (at least until the end of file was reached). Which I didn't understand, I have to admit.

Trying a different plan, I have tried a switch statement rather than a for-loop; this seems to reach the end of the file OK, but has weird output. It creates 1000+ files of one record each, but doesn't begin writing nodes (only the header info) until record 23! The switch statement is (in place of the for-loop):

switch (XmlReader.Name)
{
case "CISKASNRecord":
XmlWriter.WriteNode(XmlReader, true);
break;
case "message":
XmlWriter.WriteFullEndElement();
break;
}



Does this make more sense?
GeneralRe: How do you read the end of an XML file in C#? Pin
Ed.Poore26-Sep-06 0:25
Ed.Poore26-Sep-06 0:25 
GeneralRe: How do you read the end of an XML file in C#? Pin
bigove26-Sep-06 0:36
bigove26-Sep-06 0:36 
GeneralRe: How do you read the end of an XML file in C#? Pin
Ed.Poore26-Sep-06 1:05
Ed.Poore26-Sep-06 1:05 
GeneralRe: How do you read the end of an XML file in C#? Pin
bigove26-Sep-06 1:25
bigove26-Sep-06 1:25 
GeneralRe: How do you read the end of an XML file in C#? Pin
Ed.Poore26-Sep-06 1:30
Ed.Poore26-Sep-06 1:30 
GeneralRe: How do you read the end of an XML file in C#? Pin
bigove26-Sep-06 1:35
bigove26-Sep-06 1:35 
GeneralRe: How do you read the end of an XML file in C#? Pin
Ed.Poore26-Sep-06 1:49
Ed.Poore26-Sep-06 1:49 
GeneralRe: How do you read the end of an XML file in C#? Pin
bigove26-Sep-06 2:53
bigove26-Sep-06 2:53 
QuestionContent page script asp.net 2005 Pin
Tamimi - Code24-Sep-06 22:45
Tamimi - Code24-Sep-06 22:45 
Questionclose and reopen child forms Pin
faladrim24-Sep-06 22:33
faladrim24-Sep-06 22:33 
AnswerRe: close and reopen child forms Pin
Guffa24-Sep-06 22:39
Guffa24-Sep-06 22:39 
GeneralRe: close and reopen child forms Pin
faladrim24-Sep-06 23:28
faladrim24-Sep-06 23:28 
AnswerRe: close and reopen child forms Pin
Guffa25-Sep-06 21:15
Guffa25-Sep-06 21:15 
Questioninterchanging data Pin
V.24-Sep-06 22:10
professionalV.24-Sep-06 22:10 
AnswerRe: interchanging data Pin
Ed.Poore24-Sep-06 23:08
Ed.Poore24-Sep-06 23:08 
GeneralRe: interchanging data Pin
V.24-Sep-06 23:18
professionalV.24-Sep-06 23:18 
GeneralRe: interchanging data Pin
Ed.Poore24-Sep-06 23:24
Ed.Poore24-Sep-06 23:24 

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.