将XML文件转换为asp.net C#中的html表 [英] converting xml file to html table in asp.net c#

查看:60
本文介绍了将XML文件转换为asp.net C#中的html表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< code><?xml version =''1.0''?>

< atul>
< financial_report scale ="10000000">
< year_end_on date ="2010年3月31日">

< net_sales>
< gross_sales> 1226</gross_sales>
< less_ex_duty> 58</less_ex_duty>
< netsales> 1168</netsales>
< other_income> 30</other_income>
< total_net_sales> 1198</total_net_sales>
</net_sales>
< expenditure>
< inc_dec_stock>(24)</inc_dec_stock>
< consump> 663</consump>
< purchase> 17</purchase>
< employees> 103</employees>
< pow_fu_wtr> 113</pow_fu_wtr>
< manuf> 69</manuf>
< depreciation> 37</depreciation>
< others> 110</others>
< total> 1088</total>
</expenditure>
< profit_4m_opern> 110</profit_4m_opern>
< othr_income> 5</othr_income>
< prof_b4_intrst> 115</prof_b4_intrst>
< interst_expns> 26</interst_expns>
< prof_los_b4_xchng> 89</prof_los_b4_xchng>
< xchng_rate_diff>(9)</xchng_rate_diff>
< prof_los_4m_ordnry> 80</prof_los_4m_ordnry>
< tax_expens>
< curr_tax> 22</curr_tax>
< deferd_tax> 5</deferd_tax>
< fring_ben_tax> 0</fring_ben_tax>
< less_MAT_cred> 0</less_MAT_cred>
< total_tax> 27</total_tax>
</tax_expens>
< net_prof_los_4m_ordnry> 53</net_prof_los_4m_ordnry>
< tax_adjstmnt> 4</tax_adjstmnt>
< xtraordnry_items> 0</xtraordnry_items>
< net_prof_los_4_period> 57</net_prof_los_4_period>
< paid_up_equity> 30</paid_up_equity>
< reserv_xclusion> 344</reserv_xclusion>
< public_shareholdin>
< no_of_shares> 17228218</no_of_shares>
< percent_of_shareholdin> 0.000005808</percent_of_shareholdinin>>
</public_shareholdin>
< promtrs_n_grup_shareholdng>
< encumbered>
< no_of_shares> 2994000</no_of_shares>
< percent_of_shares_promtr_grup> 24.08</percent_of_shares_promtr_grup>
< percent_of_shares_compny> 10.09</percent_of_shares_compny>
</encumbered>
< non_encumbered>
< no_of_shares> 9439515</no_of_shares>
< percent_of_shares_promtr_grup> 0.000007592</percent_of_shares_promtr_grup>
< percent_of_shares_compny> 0.000003182</percent_of_shares_compny>
</non_encumbered>
</promtrs_n_grup_shareholdng>


</year_end_on>
</code>该xml文件如上所述,我希望每个表单元格中的每个元素都可以使用.net

<code><?xml version=''1.0''?>

<atul>
<financial_report scale="10000000">
<year_end_on date="31-mar-2010">

<net_sales>
<gross_sales>1226</gross_sales>
<less_ex_duty>58</less_ex_duty>
<netsales>1168</netsales>
<other_income>30</other_income>
<total_net_sales>1198</total_net_sales>
</net_sales>
<expenditure>
<inc_dec_stock>(24)</inc_dec_stock>
<consump>663</consump>
<purchase>17</purchase>
<employees>103</employees>
<pow_fu_wtr>113</pow_fu_wtr>
<manuf>69</manuf>
<depreciation>37</depreciation>
<others>110</others>
<total>1088</total>
</expenditure>
<profit_4m_opern>110</profit_4m_opern>
<othr_income>5</othr_income>
<prof_b4_intrst>115</prof_b4_intrst>
<interst_expns>26</interst_expns>
<prof_los_b4_xchng>89</prof_los_b4_xchng>
<xchng_rate_diff>(9)</xchng_rate_diff>
<prof_los_4m_ordnry>80</prof_los_4m_ordnry>
<tax_expens>
<curr_tax>22</curr_tax>
<deferd_tax>5</deferd_tax>
<fring_ben_tax>0</fring_ben_tax>
<less_MAT_cred>0</less_MAT_cred>
<total_tax>27</total_tax>
</tax_expens>
<net_prof_los_4m_ordnry>53</net_prof_los_4m_ordnry>
<tax_adjstmnt>4</tax_adjstmnt>
<xtraordnry_items>0</xtraordnry_items>
<net_prof_los_4_period>57</net_prof_los_4_period>
<paid_up_equity>30</paid_up_equity>
<reserv_xcluding>344</reserv_xcluding>
<public_shareholdin>
<no_of_shares>17228218</no_of_shares>
<percent_of_shareholdin>0.000005808</percent_of_shareholdin>>
</public_shareholdin>
<promtrs_n_grup_shareholdng>
<encumbered>
<no_of_shares>2994000</no_of_shares>
<percent_of_shares_promtr_grup>24.08</percent_of_shares_promtr_grup>
<percent_of_shares_compny>10.09</percent_of_shares_compny>
</encumbered>
<non_encumbered>
<no_of_shares>9439515</no_of_shares>
<percent_of_shares_promtr_grup>0.000007592</percent_of_shares_promtr_grup>
<percent_of_shares_compny>0.000003182</percent_of_shares_compny>
</non_encumbered>
</promtrs_n_grup_shareholdng>


</year_end_on>
</code> the xml file is as above i want each element in each table cell,plz help i m new to .net

推荐答案

从此处开始:XSLT教程 [ ^ ]


这篇关于将XML文件转换为asp.net C#中的html表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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