生成的XML文件格式 [英] XML file Format generated

查看:83
本文介绍了生成的XML文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

使用
生成了XML
ds.WriteXml(Application.Current.Properties ["Appath"].ToString()+"sampe.xml");

生成以下格式的XML.

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/>



但是下面的结构XML格式是什么



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>



谢谢,
Mahalakshmi S.



Thanks,
Mahalakshmi S.

推荐答案

您将相同的XML粘贴了两次.您的格式将是您创建的格式.使用System.IO.Path.Combine方法创建路径而不是字符串混搭.
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.


我的解决方案在这里

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


这篇关于生成的XML文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆