如何以预先指定的格式保存XML文件中的数据? [英] how to save data in XML file in pre specified format ?

查看:77
本文介绍了如何以预先指定的格式保存XML文件中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我是XML新手 

i'm new to XML and 

我正在研究专家系统来检测疾病 

i'm working on expert system to detect diseases 

我希望将每种疾病症状存储在xml文件中,但每种疾病都有很多症状,所以

and i want to store each disease symptoms in xml file but each disease has many symptoms so 

我想把它存储为

<疾病名称>

<Disease Name >

< Concept =" something"属性="什么" value =" something">

<Concept = "something" Property="something" value="something">

< Concept =" something"属性="什么" value =" something">

<Concept = "something" Property="something" value="something">

< Concept =" something"属性="什么" value =" something">

<Concept = "something" Property="something" value="something">

< /疾病名称>

</Disease Name>

我试图看一些xml示例,但他们让我困惑:S

i have tried to see some xml examples but they confused me :S

所以 

如何使用这种格式在xml文件中保存数据?

how can i save data in xml file with this format ?

并且可以我使用XPathFile导航XML文件还是还有别的东西?

and can i navigate XML file using XPathFile or there is something else ?

提前感谢 

thanks in advance 

 

 

 

 

推荐答案

您使用的是哪种语言?您使用的是哪个版本的.NET框架?

What language are you using? And which version of the .NET framework are you using?

VS 2008和VS 2010使用XDocument和XElement创建了一个新的XML对象模型。这是非常容易使用。如果你使用VB,你可以使用XML Literals,它也很容易使用。

VS 2008 and VS 2010 have a new XML object model using XDocument and XElement. It is *very* easy to use. And if you are using VB you can use XML Literals, which are also very easy to work with.

如果你能提供更多的信息,我们可以帮助你。

If you could provide a little more information, we may be able to help you further.

目前,这里有一些关于使用一些新XML功能的博客文章:

For now, here are some blog posts on using some of the new XML features:

http://msmvps.com/blogs/deborahk/archive/2010/06/07 /writing-to-an-xml-file-with-attributes.aspx

希望这会有所帮助。


这篇关于如何以预先指定的格式保存XML文件中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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