Click here to Skip to main content
15,908,841 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

i have 2 xml files.
One is:
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sx_xmlfile>
   <sx_header>
     <sxxml_vers>1.0</sxxml_vers>
     <sxcom_vers>8.0</sxcom_vers>
<sx_table>PLST</sx_table>
     <sx_cmd>S</sx_cmd>
     <sx_id>01</sx_id>
  </sx_header>
  <sx_data>

and second is:
XML
<sx_r>WALO0AKTI0PNUM21PLTE^7;ERIK KIRMIZIABNU1ECO10040002100000ALT10ALT20ALT30ALT40HBA10HBA20TARA0PTYP0KLAR0KLGE0FGEW0STPA0MWNU1RABZ0PREU0MWUE0PWER0HALB0GPRR0TAZW0STZW0ECTR0GPR1299EXPR0TFZU@00@04@00@00@01@F3@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00@00LFZU@00@05@00@00@00@00@00@00ANKE0WGNU1ISID455153</sx_r>
  </sx_data>
</sx_xmlfile>


How can i merge this 2 xml files in c#?

What I have tried:

Nothing special,
google search,
read some articles
Posted
Updated 1-Aug-17 20:22pm

1 solution

Make sure the tags match, I would paste the complete second file after <sx_data>.
You can use File.ReadAllText and File.AppendAllText, see: [File.ReadAllText] and [File.AppendAllText]
Then you could use XmlTextReader to read it, see: [xmltextreader]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900