本文介绍了生成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>
....
...
..









IdNameParentId
16Application0
173rd Party Applications16
18Compatibility issues17
19Unable to install17
20Unable to launch17
21Unable to uninstall17
22Unexpected behavior (crash)17
23Inbox MS Vista Applications16
51Other MS Applications16
57Hardware0
78IE0
79Browsing78
803rd Party Add-in79
81Cookies Related79
82DLL Corruption79
83DNS issues79
84Flash/java Conent79
85Links don’t work79
86Slow Browsing79
87Toolbars79
88Unable to only some sites79
89Unable to view all sites79
90Unable to view graphics79
91Web Mail79
92Customer Education - How to78
93Malware78
94Others78
95Script errors78
96Silverlight78
97Unable to open or close IE78
98Unable to print78
99Unable to retain or set homepage78

推荐答案


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

07-01 15:31