XML编程与应用教程第二版上机答案

上传人:一** 文档编号:46117945 上传时间:2021-12-10 格式:DOCX 页数:10 大小:13.27KB
返回 下载 相关 举报
XML编程与应用教程第二版上机答案_第1页
第1页 / 共10页
XML编程与应用教程第二版上机答案_第2页
第2页 / 共10页
XML编程与应用教程第二版上机答案_第3页
第3页 / 共10页
点击查看更多>>
资源描述
XML编程与应用教程第二版上机答案 上机题 1、 lt;?xml version=quot;1.0quot; encoding=quot;gb2312quot;?gt; lt;bookgt; lt;titlegt;XML 指南lt;/titlegt; lt;chaptergt;XML 入门简介 lt;paragt;什么是 HTMLlt;/paragt; lt;paragt;什么是 XMLlt;/paragt; lt;/chaptergt; lt;chaptergt;XML 语法 lt;paragt;XML 元素必须有结束标签lt;/paragt; lt;paragt;XML 元素必须正确的嵌套lt;/paragt; lt;/chaptergt; lt;/bookgt; 2、 lt;?xml version=quot;1.0quot; encoding=quot;gb2312quot;?gt; lt;employeesgt; lt;employeegt; lt;idgt;1lt;/idgt; lt;namegt;张三lt;/namegt; lt;agegt;32lt;/agegt; lt;sexgt;男lt;/sexgt; lt;addressgt;上海lt;/addressgt; lt;/employeegt; lt;employeegt; lt;idgt;2lt;/idgt; lt;namegt;李四lt;/namegt; lt;agegt;22lt;/agegt; lt;sexgt;男lt;/sexgt; lt;addressgt;北京lt;/addressgt; lt;/employeegt; lt;/employeesgt; 3、 lt;?xml version=quot;1.0quot; encoding=quot;gb2312quot;?gt; lt;studentsgt; lt;studentgt; lt;numbergt;1lt;/numbergt; lt;namegt;tomlt;/namegt; lt;scoregt;100lt;/scoregt; lt;/studentgt; lt;studentgt; lt;numbergt;2lt;/numbergt; lt;namegt;marylt;/namegt; lt;scoregt;98lt;/scoregt; lt;/studentgt; lt;/studentsgt; 第三章 上机题 1、 lt;?xml version=quot;1.0quot; encoding=quot;GB2312quot;?gt; lt;!ELEMENT 学生名册(学生+)gt; lt;!ELEMENT 学生(姓名,性别, 年龄)gt; lt;!ELEMENT 姓名(#PCDATA)gt; lt;!ELEMENT 性别(#PCDATA)gt; lt;!ELEMENT 年龄(#PCDATA)gt; lt;!ATTLIST 学生 学号 ID #REQUIREDgt; 2、 lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt; lt;NEWSPAPERgt; lt;ARTICLE AUTHOR='amp;NEWSPAPER;' EDITOR='amp;PUBLISHER;' DATE='2021-6-1' EDITION ='amp;COPYRIGHT;'gt; lt;HEADLINEgt;Environment Protectionlt;/ HEADLINEgt; lt;BYLINEgt; Material waste lt;/BYLINEgt; lt;LEADgt;amp;PUBLISHER;lt;/LEADgt; lt;BODYgt; it means the waste of substance or things from which something else can be made. For example, people throw away the used metal products and buy a new one, so the old metal waste accumulates. At last, they become waste. For example, when people finish reading newspaper, the paper will become waste. When the glass is broken, it also becomes waste. Nobody wants to use a broken window or drink with a broken glass or wear a pair of broken glasses. Once it is broken, it becomes waste. The rate of using plastics is increasing day by day. People use plastic bags because they are convenient. When they get home, they throw the plastics way, paying no attention to the environment. The more convenience plastics brings to us, the more plastic waste is produced. This is called "white pollution' as most plastics are white. Some of our products we use every day are made of rubber, just like the tyres and the bottom part of our shoes. Its true that rubber plays an important role in our life. However, it also brings us some trouble when it has been used for a long time and becomes old. The old tyres become waste because it cant break down by nature. This is really a big problem. lt;/BODYgt; lt;NOTESgt; Protecting the environment is not one persons duty; it depends on all of us. What can we do? Maybe a dozen. In a word, use what can reuse as much as possible. Remember, environment protection is not ones duty! lt;/NOTESgt; lt;/ ARTICLEgt; lt;/ NEWSPAPERgt; 3、 lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt; lt;!DOCTYPE NEWSPAPER lt;!ELEMENT NEWSPAPER (ARTICLE+)gt; lt;!ELEMENT ARTICLE (HEADLINE,BYLINE,LEAD,BODY,NOTES)gt; lt;!ELEMENT HEADLINE (#PCDATA)gt; lt;!ELEMENT BYLINE (#PCDATA)gt; lt;!ELEMENT LEAD (#PCDATA)gt; lt;!ELEMENT BODY (#PCDATA)gt; lt;!ELEMENT NOTES (#PCDATA)gt; lt;!ATTLIST ARTICLE AUTHOR CDATA #REQUIREDgt; lt;!ATTLIST ARTICLE EDITOR CDATA #IMPLIEDgt; lt;!ATTLIST ARTICLE DATE CDATA #IMPLIEDgt; lt;!ATTLIST ARTICLE EDITION CDATA #IMPLIEDgt; lt;!ENTITY NEWSPAPER quot;Vervet Logic Timesquot;gt; lt;!ENTITY PUBLISHER quot;Vervet Logic Pressquot;gt; lt;!ENTITY COPYRIGHT quot;Copyright 1998 Vervet Logic Pressquot;gt; gt; lt;NEWSPAPERgt; lt;ARTICLE AUTHOR='amp;NEWSPAPER;' EDITOR='amp;PUBLISHER;' DATE='2021-6-1' EDITION ='amp;COPYRIGHT;'gt; lt;HEADLINEgt;Environment Protectionlt;/ HEADLINEgt; lt;BYLINEgt; Material waste lt;/BYLINEgt; lt;LEADgt;amp;PUBLISHER;lt;/LEADgt; lt;BODYgt; it means the waste of substance or things from which something else can be made. For example, people throw away the used metal products and buy a new one, so the old metal waste accumulates. At last, they become waste. For example, when people finish reading newspaper, the paper will become waste. When the glass is broken, it also becomes waste. Nobody wants to use a broken window or drink with a broken glass or wear a pair of broken glasses. Once it is broken, it becomes waste. The rate of using plastics is increasing day by day. People use plastic bags because they are convenient. When they get home, they throw the plastics way, paying no attention to the environment. The more convenience plastics brings to us, the more plastic waste is produced. This is called "white pollution' as most plastics are white. Some of our products we use every day are made of rubber, just like the tyres and the bottom part of our shoes. Its true that rubber plays an important role in our life. However, it also brings us some trouble when it has been used for a long time and becomes old. The old tyres become waste because it cant break down by nature. This is really a big problem. lt;/BODYgt; lt;NOTESgt; Protecting the environment is not one persons duty; it depends on all of us. What can we do? Maybe a dozen. In a word, use what can reuse as much as possible. Remember, environment protection is not ones duty! lt;/NOTESgt; lt;/ ARTICLEgt; lt;/ NEWSPAPERgt; 第四章 上机题 1、 lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt; lt;xs:schema xmlns:xs=quot;lgt; lt;headgt; lt;titlegt;订单信息lt;/titlegt; lt;/headgt; lt;bodygt; lt;h2 align=quot;centerquot;gt;订单lt;/h2gt; lt;table border=quot;1quot; cellpadding=quot;0quot; align=quot;centerquot;gt; lt;trgt;lt;thgt;名称lt;/thgt;lt;thgt;数量lt;/thgt;lt;thgt;城市lt;/thgt;lt;thgt;邮编lt;/thgt;lt;/trgt; lt;xsl:for-each select=quot;/ Orders / Orderquot;gt; lt;trgt; lt;tdgt;lt;xsl:value-of select=quot;namequot;/gt;lt;/tdgt; lt;tdgt;lt;xsl:value-of select=quot; number quot;/gt;lt;/tdgt; lt;tdgt;lt;xsl:value-of select=quot; city quot;/gt;lt;/tdgt; lt;tdgt;lt;xsl:value-of select=quot; zip quot;/gt;lt;/tdgt; lt;/trgt; lt;/xsl:for-eachgt; lt;/tablegt; lt;/bodygt; lt;/htmlgt; lt;/xsl:templategt; lt;/xsl:stylesheetgt; 2)、 lt;?xml version=quot;1.0quot; encoding=quot;gb2312quot; ?gt; lt;xsl:stylesheet version=quot;1.0quot; xmlns:xsl=quot;lgt; lt;headgt; lt;titlegt;订单信息lt;/titlegt; lt;/headgt; lt;bodygt; lt;h2 align=quot;centerquot;gt;订单lt;/h2gt; lt;table border=quot;1quot; cellpadding=quot;0quot; align=quot;centerquot;gt; lt;trgt;lt;thgt;名称lt;/thgt;lt;thgt;数量lt;/thgt;lt;thgt;城市lt;/thgt;lt;thgt;邮编lt;/thgt;lt;/trgt; lt;xsl:if test=quot;/OrderorderID=" A002"quot;gt; lt;trgt; lt;tdgt;lt;xsl:value-of select=quot;namequot;/gt;lt;/tdgt; lt;tdgt;lt;xsl:value-of select=quot; number quot;/gt;lt;/tdgt; lt;tdgt;lt;xsl:value-of select=quot; city quot;/gt;lt;/tdgt; lt;tdgt;lt;xsl:value-of select=quot; zip quot;/gt;lt;/tdgt; lt;/trgt; lt;/xsl:ifgt; lt;/tablegt; lt;/bodygt; lt;/htmlgt; lt;/xsl:templategt; lt;/xsl:stylesheetgt; 3)、 lt;?xml version=quot;1.0quot; encoding=quot;gb2312quot; ?gt; lt;xsl:stylesheet version=quot;1.0quot; xmlns:xsl=quot;lgt; lt;headgt; lt;titlegt;订单信息lt;/titlegt; lt;/headgt; lt;bodygt; lt;h2 align=quot;centerquot;gt;订单lt;/h2gt; lt;table border=quot;1quot; cellpadding=quot;0quot; align=quot;centerquot;gt; lt;trgt;lt;thgt;名称lt;/thgt;lt;thgt;数量lt;/thgt;lt;thgt;城市lt;/thgt;lt;thgt;邮编lt;/thgt;lt;/trgt; lt;xsl:if test=quot; city .="北京"quot;gt; lt;trgt; lt;tdgt;lt;xsl:v.
展开阅读全文
相关资源
相关搜索

最新文档


当前位置:首页 > 办公文档 > 工作计划


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!