生成XML树结构 [英] Generate XML Tree Structure

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

问题描述

我想形成如下所示的XML文档,以便将该数据发送到frontend(.net)以创建树结构.这里,我将示例数据附加到excel中.

像需要从表FOR XML AUTO,TYPE,ELEMENTS中写入select .....

< item id ="16" name ="Application">
< item id ="17" name ="3rd Party Applications">
< item id ="18" name =兼容性问题">
< item id ="19" name =无法安装">
< item id ="19" name =无法启动">
< item id ="19" name =无法卸载">

< item>
< item id ="78" name ="IE">

< item id ="79" name =浏览">
< item id ="81" name =与Cookie相关的">
< item id ="82" name ="DLL损坏">
< item id ="83" name ="DNS问题">
...
...

< item>
< item>
....
...
..



样本数据





ID名称ParentId
16应用0
17第三方申请16
18兼容性问题17
19无法安装17
20无法启动17
21无法卸载17
22意外行为(崩溃)17
23个收件箱MS Vista应用程序16
51其他MS应用程序16
57硬件0
78 IE 0
79浏览78
80 3rd Party插件79
81个饼干相关79
82 DLL损坏79
83个DNS问题79
84 Flash/java Conent 79
85链接无效79
86慢速浏览79
87工具栏79
88无法仅访问某些网站79
89无法查看所有站点79
90无法查看图形79
91 Web Mail 79
92客户培训-如何78
93恶意软件78
94其他78
95脚本错误78
96 Silverlight 78
97无法打开或关闭IE 78
98无法打印78
99无法保留或设置主页78

I want to form an XML document something like below in order to send this data to frontend( .net) to create tree structure.Herewith I have attached the sample Data in excel.

like need to write select ..... from table FOR XML AUTO,TYPE,ELEMENTS

<item id="16" name="Application">
<item id="17" name="3rd Party Applications">
<item id="18" name="Compatibility issues">
<item id="19" name="Unable to install">
<item id="19" name="Unable to launch">
<item id="19" name="Unable to uninstall">

<item>
<item id="78" name="IE">

<item id="79" name="Browsing">
<item id="81" name="Cookies Related">
<item id="82" name="DLL Corruption">
<item id="83" name="DNS issues">
...
...

<item>
<item>
....
...
..



Sample Data





Id Name ParentId
16 Application 0
17 3rd Party Applications 16
18 Compatibility issues 17
19 Unable to install 17
20 Unable to launch 17
21 Unable to uninstall 17
22 Unexpected behavior (crash) 17
23 Inbox MS Vista Applications 16
51 Other MS Applications 16
57 Hardware 0
78 IE 0
79 Browsing 78
80 3rd Party Add-in 79
81 Cookies Related 79
82 DLL Corruption 79
83 DNS issues 79
84 Flash/java Conent 79
85 Links don’t work 79
86 Slow Browsing 79
87 Toolbars 79
88 Unable to only some sites 79
89 Unable to view all sites 79
90 Unable to view graphics 79
91 Web Mail 79
92 Customer Education - How to 78
93 Malware 78
94 Others 78
95 Script errors 78
96 Silverlight 78
97 Unable to open or close IE 78
98 Unable to print 78
99 Unable to retain or set homepage 78

推荐答案

您的问题是什么?你有问题吗?还是您要求我们为您工作?
What is your question? Do you have a question? Or are you requesting we do work for you?


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

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