Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Freinds,

Have generated the XML using

ds.WriteXml(Application.Current.Properties["Appath"].ToString() + "sampe.xml");

The below format XML generated.

 <?xml version="1.0" standalone="yes" ?> 
 <Root>
 <KYCDATA>
  <columndiff>1</columndiff> 
  <acct_code>1765</acct_code> 
  <dpid>12063700</dpid> 
  <APP_UPDTFLG>0</APP_UPDTFLG> 
  <APP_POS_CODE /> 
  <APP_TYPE /> 
 <KYCDATA/>
<Root/>


But What the below stucture XML format

<Root>
<KYCDATA>
 <columndiff>1</columndiff>
 <acct_code>1765</acct_code>
 <dpid>12063700</dpid>
 <APP_UPDTFLG>0</APP_UPDTFLG>
 <APP_POS_CODE />
 <APP_TYPE />
<KYCDATA>
<Root>


Thanks,
Mahalakshmi S.
Posted
Comments
Santhosh Kumar Jayaraman 4-Aug-12 3:51am    
Whats the issue now?
Sebastian T Xavier 4-Aug-12 4:00am    
Is there any question?
lakshmi.ksangam 4-Aug-12 4:50am    
in the first file have name space "?xml version="1.0" standalone="yes" ?". I want the XML file without name space

You pasted the same XML twice. Your format will be the format you created. Use the System.IO.Path.Combine method to create paths instead of string mashing.
 
Share this answer
 
Comments
lakshmi.ksangam 4-Aug-12 4:50am    
in the first file have name space "?xml version="1.0" standalone="yes" ?". I want the XML file without name space
Christian Graus 4-Aug-12 16:29pm    
That XML tag is standard, and does not supply a namespace. It should make no difference.
lakshmi.ksangam 8-Sep-12 3:19am    
Had find the solution for this question. Had removed the version details ("?xml version="1.0" standalone="yes" ?") in XML file.
My solution is here

dsExport.WriteXml(_appath + "\\" + strfilename);
StreamReader streamReader;
streamReader = File.OpenText(_appath + "\\" + strfilename);                    
string contents = streamReader.ReadToEnd();
streamReader.Close();
StreamWriter streamWriter = File.CreateText(_appath + "\\" + strfilename);  
streamWriter.Write(contents.Substring(contents.IndexOf("?>")+2));
streamWriter.Close();      


Thanks
 
Share this answer
 

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