zoukankan      html  css  js  c++  java
  • XML读取及网页显示

    例题:学生成绩的XML文档

    <?xml version="1.0" encoding="gb2312"?>

    <students>

           <student id="05001">

                         <name>张三</name>

                         <dept>计算机</dept>

                         <course id="001">

                                <title>C程序设计</title>

                                <score>85</score>

                          <date>2000/12/04</date>

                         </course>

                         <course id="002">

                                <title>编译方法</title>

                                <score>79</score>

                          <date>2000/12/06</date>

                         </course>

                         <course id="003">

                                <title>数据结构</title>

                                <score>93</score>

                          <date>2000/12/10</date>

                         </course>

           </student>

           <student id="05002">

                         <name>李四</name>

                         <dept>数学</dept>

                         <course id="004">

                                <title>计算方法</title>

                                <score>95</score>

                          <date>2000/12/04</date>

                         </course>

                         <course id="005">

                                <title>偏微分方程</title>

                                <score>86</score>

            <date>2000/12/07</date>

                         </course>

                         <course id="006">

                                <title>计算复杂性</title>

                                <score>72</score>

                          <date>2000/12/03</date>

                         </course>

           </student>

           <student id="05003">

                         <name>王五</name>

                         <dept>化学</dept>

                         <course id="007">

                                <title>有机化学</title>

                                <score>80</score>

                          <date>2000/12/09</date>

                         </course>

                         <course id="008">

                                <title>无机化学</title>

                                <score>98</score>

                          <date>2000/12/15</date>

                         </course>

                         <course id="009">

                                <title>分子轨道理论</title>

                                <score>79</score>

                          <date>2000/12/23</date>

                         </course>

                         <course id="010">

                                <title>分子生物学</title>

                                <score>88</score>

                          <date>2000/11/27</date>

                         </course>

           </student>

    </students>

    请利用XMLDOM和XSLT编写如下的网页, 通过选择姓名来动态显示每个学生的成绩单。

    请给出网页的代码和运行效果的截屏。

    要求效果图:

    关于xml,xsl,html几者之间的关系以及调用就不再赘述,直接上源码与效果图。

    Xml部分:

    Xsl部分:

    Html部分:

    Loadxmldoc.js部分(就是默认用法了):

    运行效果截图:

     

  • 相关阅读:
    Linux oracle操作
    Job
    Oracle创建表空间和用户并分配权限
    Oracle赋予用户查询另一个用户所有表的权限
    plsql中文乱码解决方案
    PLSQL创建Oracle定时任务,定时执行存储过程
    fcntl函数参数F_GETPIPE_SZ、F_SETPIPE_SZ报错引出的关于linux-specific头文件的使用方法
    从Windows Server 2008 迁移mantis到CentOS 6.8
    从Windows Server 2008 迁移VisualSVN到CentOS 6.8
    CentOS 6.8上开启NFS服务给不同用户使用的曲线设置方法
  • 原文地址:https://www.cnblogs.com/STK0210/p/10265892.html
Copyright © 2011-2022 走看看