Click here to Skip to main content
15,912,504 members
Home / Discussions / C#
   

C#

 
Questiongenerating XML file issue Pin
George_George28-Nov-08 21:49
George_George28-Nov-08 21:49 
AnswerRe: generating XML file issue Pin
Wendelius28-Nov-08 22:27
mentorWendelius28-Nov-08 22:27 
GeneralRe: generating XML file issue Pin
George_George28-Nov-08 22:35
George_George28-Nov-08 22:35 
GeneralRe: generating XML file issue Pin
Wendelius28-Nov-08 22:48
mentorWendelius28-Nov-08 22:48 
GeneralRe: generating XML file issue Pin
George_George28-Nov-08 23:49
George_George28-Nov-08 23:49 
GeneralRe: generating XML file issue Pin
User 665829-Nov-08 0:22
User 665829-Nov-08 0:22 
GeneralRe: generating XML file issue Pin
George_George29-Nov-08 1:25
George_George29-Nov-08 1:25 
GeneralRe: generating XML file issue Pin
Wendelius29-Nov-08 0:28
mentorWendelius29-Nov-08 0:28 
I think you have at least three options:
1. Create the document fully manually by looping the objects you want and add the information to the document you need
2. First serialize the objects, then loop through the xml documents created by serialization, read them and copy the relevant nodes to a single document
3. Create a generic collection (or nested collections if you need) and add your objects into that collection. After that, serialize it

I guess that if you have strict requirements for the xml 'format', serialization may not produce automatically the format you need. Also you can implement ISerializable on your objects, but that may be a longer way.

The need to optimize rises from a bad design.

My articles[^]

GeneralRe: generating XML file issue Pin
George_George29-Nov-08 1:27
George_George29-Nov-08 1:27 
GeneralRe: generating XML file issue Pin
Wendelius29-Nov-08 1:39
mentorWendelius29-Nov-08 1:39 
GeneralRe: generating XML file issue Pin
George_George30-Nov-08 3:59
George_George30-Nov-08 3:59 
GeneralRe: generating XML file issue Pin
Wendelius30-Nov-08 4:24
mentorWendelius30-Nov-08 4:24 
GeneralRe: generating XML file issue Pin
George_George30-Nov-08 18:32
George_George30-Nov-08 18:32 
GeneralRe: generating XML file issue Pin
Wendelius30-Nov-08 18:34
mentorWendelius30-Nov-08 18:34 
AnswerRe: generating XML file issue [modified] Pin
darkzangel29-Nov-08 10:15
darkzangel29-Nov-08 10:15 
GeneralRe: generating XML file issue Pin
George_George30-Nov-08 18:26
George_George30-Nov-08 18:26 
AnswerRe: generating XML file issue Pin
N a v a n e e t h29-Nov-08 16:21
N a v a n e e t h29-Nov-08 16:21 
GeneralRe: generating XML file issue Pin
George_George30-Nov-08 18:27
George_George30-Nov-08 18:27 
QuestionProperties and User Ma... Pin
jas0n2328-Nov-08 20:38
jas0n2328-Nov-08 20:38 
AnswerRe: Properties and User Ma... Pin
Wendelius28-Nov-08 22:29
mentorWendelius28-Nov-08 22:29 
AnswerRe: Properties and User Ma... Pin
Dave Kreskowiak29-Nov-08 4:59
mveDave Kreskowiak29-Nov-08 4:59 
GeneralRe: Properties and User Ma... Pin
jas0n2329-Nov-08 5:14
jas0n2329-Nov-08 5:14 
Question[Message Deleted] Pin
jas0n2328-Nov-08 19:33
jas0n2328-Nov-08 19:33 
AnswerRe: URL Regular Expression f... Pin
AhsanS28-Nov-08 20:36
AhsanS28-Nov-08 20:36 
GeneralRe: URL Regular Expression f... Pin
jas0n2328-Nov-08 20:40
jas0n2328-Nov-08 20:40 

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.