动态XMl [英] Dynamic XMl

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

问题描述

有人可以帮我解决当前这个问题。

Can someone help me with this current problem.

以下是我想要实现的指南,是否有任何教程使用VS 2008进行此操作?

Here are the guidelines that i would like to fulfill, is there any tutorials doing this with VS 2008?


  • 使用地址簿XML文件,在地址簿xml中,每个联系人都应包含以下信息。

    • 姓名
    • 电话号码
    • 班级(小学,高中,大学)
    • 性别

    • 应该有两个下拉列表,一个是按联系人姓名,另一个是按类别。两个列表都应包含"全选"。选项。选择选项后,页面将相应显示联系信息。
    • 使用Ajax技术从地址簿XML文件中请求信息。
    • 为每个性别使用不同的背景颜色。

    推荐答案

    我假设您的Xml文件充当了数据库并存储在服务器上。

    I assume that your Xml file is acting as a database and is stored on the server.

    为了创建HTML,您有几个选项 -

    - 您可以在服务器上使用Xslt样式表来转换Xml将文件发送到将显示给用户的Html页面


    - 您可以创建一个aspx页面,根据您拥有$ b $的xml文件为用户构建html节目b

    - 您可以创建一个HTML页面,使用javascript读取xml文件的内容(使用XmlHTTPRequest),然后选择您感兴趣的XPath元素并填充所有UI(下拉等)。 )与数据。

    For creating the HTML you have a few options -
    - you can use Xslt stylesheet on the server to transform the Xml file to an Html page that will be shown to the user
    - you can create an aspx page that will build html show to the user based on the xml file you have
    - you can create an HTML page that uses javascript to read contents of the xml file (using XmlHTTPRequest) and then select with XPath elements you are interested in and fill all the UI (drop downs etc.) with the data.

    据我所知,不可能从javascript写一个文件。因此,您可能必须向服务器发送请求以保存数据。

    As far as I know it's not possible to write a file from javascript. So you will probably have to send a request to the server to save the data.

    请注意,使用Xml文件作为数据库类型并不是一个好主意。随着文件的增长,处理速度会变慢。更重要的是,并发访问将成为一个问题 - 当几个人试图访问该文件时,您可以点击异常
    表示该文件已被使用。如果这是一个真实世界的应用程序,我建议使用真正的数据库。 SqlExpress似乎是一个合理的选择并且是免费的。

    Note that using Xml file as kind-of database is not really a good idea. As the file grows bigger processing will be slower. Even more importantly concurrent access will be a problem - when several people are trying to access the file you can hit exceptions saying that the file is already in use. If this is a real world application I would recommend using a real database. SqlExpress seems like a reasonable choice and is free.

    Pawel


    这篇关于动态XMl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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