XML编程与应用教程第二版上机答案.docx
- 文档编号:18342905
- 上传时间:2023-08-15
- 格式:DOCX
- 页数:51
- 大小:40.75KB
XML编程与应用教程第二版上机答案.docx
《XML编程与应用教程第二版上机答案.docx》由会员分享,可在线阅读,更多相关《XML编程与应用教程第二版上机答案.docx(51页珍藏版)》请在冰点文库上搜索。
XML编程与应用教程第二版上机答案
XML编程与应用教程第二版上机答案
上机题
1、
xmlversion="1.0"encoding="gb2312"?
>
2、
xmlversion="1.0"encoding="gb2312"?
>
3、
xmlversion="1.0"encoding="gb2312"?
>
第三章
上机题
1、
xmlversion="1.0"encoding="GB2312"?
>
ELEMENT学生名册(学生+)>
ELEMENT学生(姓名,性别,年龄)>
ELEMENT姓名(#PCDATA)>
ELEMENT性别(#PCDATA)>
ELEMENT年龄(#PCDATA)>
ATTLIST学生学号ID#REQUIRED>
2、
xmlversion="1.0"encoding="UTF-8"?
>
itmeansthewasteofsubstanceorthingsfromwhichsomethingelsecanbemade.Forexample,peoplethrowawaytheusedmetalproductsandbuyanewone,sotheoldmetalwasteaccumulates.Atlast,theybecomewaste.Forexample,whenpeoplefinishreadingnewspaper,thepaperwillbecomewaste.Whentheglassisbroken,italsobecomeswaste.Nobodywantstouseabrokenwindowordrinkwithabrokenglassorwearapairofbrokenglasses.Onceitisbroken,itbecomeswaste.Therateofusingplasticsisincreasingdaybyday.Peopleuseplasticbagsbecausetheyareconvenient.Whentheygethome,theythrowtheplasticsway,payingnoattentiontotheenvironment.Themoreconvenienceplasticsbringstous,themoreplasticwasteisproduced.Thisiscalled“whitepollution”asmostplasticsarewhite.Someofourproductsweuseeverydayaremadeofrubber,justlikethetyresandthebottompartofourshoes.It’struethatrubberplaysanimportantroleinourlife.However,italsobringsussometroublewhenithasbeenusedforalongtimeandbecomesold.Theoldtyresbecomewastebecauseitcan’tbreakdownbynature.Thisisreallyabigproblem.
Protectingtheenvironmentisnotoneperson’sduty;itdependsonallofus.Whatcanwedo?
Maybeadozen..
Inaword,usewhatcanreuseasmuchaspossible.Remember,environmentprotectionisnotone’sduty!
3、
xmlversion="1.0"encoding="UTF-8"?
>
DOCTYPENEWSPAPER[
ELEMENTNEWSPAPER(ARTICLE+)>
ELEMENTARTICLE(HEADLINE,BYLINE,LEAD,BODY,NOTES)>
ELEMENTHEADLINE(#PCDATA)>
ELEMENTBYLINE(#PCDATA)>
ELEMENTLEAD(#PCDATA)>
ELEMENTBODY(#PCDATA)>
ELEMENTNOTES(#PCDATA)>
ATTLISTARTICLEAUTHORCDATA#REQUIRED>
ATTLISTARTICLEEDITORCDATA#IMPLIED>
ATTLISTARTICLEDATECDATA#IMPLIED>
ATTLISTARTICLEEDITIONCDATA#IMPLIED>
ENTITYNEWSPAPER"VervetLogicTimes">
ENTITYPUBLISHER"VervetLogicPress">
ENTITYCOPYRIGHT"Copyright1998VervetLogicPress">
]>
itmeansthewasteofsubstanceorthingsfromwhichsomethingelsecanbemade.Forexample,peoplethrowawaytheusedmetalproductsandbuyanewone,sotheoldmetalwasteaccumulates.Atlast,theybecomewaste.Forexample,whenpeoplefinishreadingnewspaper,thepaperwillbecomewaste.Whentheglassisbroken,italsobecomeswaste.Nobodywantstouseabrokenwindowordrinkwithabrokenglassorwearapairofbrokenglasses.Onceitisbroken,itbecomeswaste.Therateofusingplasticsisincreasingdaybyday.Peopleuseplasticbagsbecausetheyareconvenient.Whentheygethome,theythrowtheplasticsway,payingnoattentiontotheenvironment.Themoreconvenienceplasticsbringstous,themoreplasticwasteisproduced.Thisiscalled“whitepollution”asmostplasticsarewhite.Someofourproductsweuseeverydayaremadeofrubber,justlikethetyresandthebottompartofourshoes.It’struethatrubberplaysanimportantroleinourlife.However,italsobringsussometroublewhenithasbeenusedforalongtimeandbecomesold.Theoldtyresbecomewastebecauseitcan’tbreakdownbynature.Thisisreallyabigproblem.
Protectingtheenvironmentisnotoneperson’sduty;itdependsonallofus.Whatcanwedo?
Maybeadozen..
Inaword,usewhatcanreuseasmuchaspossible.Remember,environmentprotectionisnotone’sduty!
第四章
上机题
1、
xmlversion="1.0"encoding="UTF-8"?
>
schemaxmlns: xs="http: //www.w3.org/2001/XMLSchema"> elementname="Orders"type="ord"/> complexTypename="ord"> elementname="Order"> complexType> sequence> elementname="name"type="xs: string"/> elementname="number"type="numgs"/> elementname="city"type="xs: string"/> elementname="zip"type="zipgs"/> sequence> attributename="orderID"type="idgs"use="required"/> attributename="orderDate"type="xs: date"use="optional"/> complexType> element> complexType> simpleTypename=“zipgs”> restrictionbase=“xs: string”> lengthvalue=“6”/> patternvalue=“\d{6}”/> restriction> simpleType> simpleTypename=“idgs”> restrictionbase=“xs: string”> lengthvalue=“4”/> patternvalue=“[A]{1}\d{3}”/> restriction> simpleType> simpleTypename=“numgs”> restrictionbase=“xs: positiveInteger”> maxInclusivevalue=“99”/> minInclusicevalue=“1”/> restriction> simpleType> schema> 2、 xmlversion="1.0"? > schemaxmlns: xsd="http: //www.w3.org/2001/XMLSchema"> attributename="PRODID"type="pid"/> simpleTypename="pid"> restrictionbase="xsd: string"> patternvalue="[P]{1}\d{3}"/> restriction> simpleType> elementname="PRODUCTDATA"type="prdata"/> complexTypename="prdata"> sequence> elementname="PRODUCT"> complexType> sequence> elementname="PRODUCTNAME"type="xsd: string"/> elementname="DESCRIPTION"type="xsd: string"/> elementname="PRICE"type="xsd: positiveInteger"/> elementname="QUANTITY"type="xsd: nonNegativeInteger"/> sequence> attributeref="PRODID"use="required"> attribute> attributename="CATEGORY"type="cat"use="required"/> complexType> element> sequence> complexType> si9mpleTypename="cat"> restrictionbase="xsd: string"> enumerationvalue="Toy"/> enumerationvalue="Book"/> restriction> simpleType> schema> 3、 xmlversion="1.0"encoding="UTF-8"? > schemaxmlns: xs="http: //www.w3.org/2001/XMLSchema"> elementname="PURCHASEORDER"type="pur"/> complexTypename="pur"> elementname="Order"> complexType> sequence> elementname="DATE"type="xs: date"/> elementname="PRODUCTNAME"type="xs: string"/> elementname="SUPPLIERNAME"type="xs: string"/> elementname="ADDRESS"type="xs: string"/> elementname="QUANTITY"type="xs: positiveInteger"/> elementname="PRICEPERQTY"type="xs: positiveInteger"/> sequence> complexType> element> attributename="ORDERID"type="xs: string"use="required"/> attributename="PRODID"type="xs: string"use="optional"/> complexType> schema> 第五章 上机题 1、 1)、 xmlversion="1.0"encoding="gb2312"? > stylesheetversion="1.0"xmlns: xsl="http: //www.w3.org/1999/XSL/Transform"> templatematch="/"> for-eachselect="/Orders/Order"> value-ofselect="name"/> value-ofselect="number"/> value-ofselect="city"/> value-ofselect="zip"/> /tr> for-each> template> stylesheet> 2)、 xmlversion="1.0"encoding="gb2312"? > stylesheetversion="1.0"xmlns: xsl="http: //www.w3.org/1999/XSL/Transform"> templatematch="/"> iftest="//Order[@orderID='A002']"> value-ofselect="name"/> value-ofselect="number"/> value-ofselect="city"/> value-ofselect="zip"/> if> template> stylesheet> 3)、 xmlversion="1.0"encoding="gb2312"? > stylesheetversion="1.0"xmlns: xsl="http: //www.w3.org/1999/XSL/Transform"> templatematch="/"> iftest="city[.='北京']"> value-ofselect="name"/> value-ofselect="number"/> value-ofselect="city"/> value-ofselect="zip"/>
名称 数量 城市 邮编 名称 数量 城市 邮编 名称 数量 城市 邮编
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- XML 编程 应用 教程 第二 上机 答案