一道面试题,偶做不出来,高手帮看!

唐力伟 2005-12-14 03:57:47
<html>
<head>
<title>试题4</title>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</head>

<body>
试题4
<br>
测试内容:对xml字符串进行解析处理。(共20分)
<br>文本域1:
<br>
<textarea name="xmlString1" cols="80" rows="8">
<?xml version="1.0" encoding="GB2312"?>
<feature xmlns:v="urn:schemas-microsoft-com:vml">
<region>
<style id="R01">
<v:fill on="true" color="#ffff00" opacity="30%" />
</style>
</region>
</feature>
</textarea>
<br>文本域2:
<br>
<textarea name="xmlString2" cols="80" rows="3">
<?xml version="1.0"?>
<v:rect style="width:100;height:100" />
</textarea>
<br>文本域3:
<br>
<textarea name="xmlString3" cols="80" rows="5">
</textarea>
<br><br>要求:<br>
1、用DOM对象加载“文本域1”和“文本域2”中的xml字符串。(5分)
<br>
2、为“文本域2”中的xml添加子节点:(15分)
<br>2.1、先将“文本域1”中的v:fill节点克隆到“文本域2”中的xml的v:rect节点下。
<br>2.2、再新建一个v:stroke节点,该节点有on、color和weight三个属性;
<br>将新建的节点也加到“文本域2”中的xml的v:rect节点下。
<br>2.3、在页面上的效果是:当点击“提交”按钮时,在“文本域3”中能看到以下结果:
<br>
<?xml version="1.0"?><br>
<v:rect style="width:100;height:100" ><br>
  <v:stroke on="true" color="#3366FF" weight="2pt"/><br>
  <v:fill on="true" color="#ffff00" opacity="30%"
/><br>
</v:rect> <br>
=========================================================================================

<br>
<input type="button" value="提交" onClick="showResult()">
</body>
</html>
...全文
61 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧