如何在xml文件之间建立关联 [英] how to give relationhip between xml files

查看:104
本文介绍了如何在xml文件之间建立关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想学习如何在asp.net中的两个或多个xml文件中建立关系
例如如果我想将state.xml赋予state.xml,那么该怎么办?

i want to learn how to give relationship in two or more xml files in asp.net
for eg. if i want to give relationship country.xml to state.xml then what should i do?

推荐答案

这种关系来自数据,而不是文件类型.似乎您犯了一个相当大的错误,认为XML文件是一种数据库类型,而事实并非如此.

您正在谈论的国家"和州"关系实际上不是主键/外键关系,而是层次结构.这是您可以在单个.XML文件中轻松完成的事情.

除非您的XML文件中已经有某种关键关系数据,否则您将发现如果不添加不需要的额外数据就不可能做到这一点.
The relationship comes from the data, not the file type. It would seem that you''re making the rather large mistake of thinking an XML file is a type of database and it''s not.

The "country" and "state" relationship you''re talking about is not really a primary/foreign key relationship, but rather a hierarchy. This is comething you could eaily do in a single .XML file.

Unless you have some kind of key relation data in your XML files already, you''re going to find this is impossible to do without adding extra data you don''t really need.


这篇关于如何在xml文件之间建立关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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