毕业设计论文译文html和xhtml的区别.doc

上传人:坚持 文档编号:3628803 上传时间:2019-06-27 格式:DOC 页数:8 大小:41KB
下载 相关 举报
毕业设计论文译文html和xhtml的区别.doc_第1页
第1页 / 共8页
毕业设计论文译文html和xhtml的区别.doc_第2页
第2页 / 共8页
毕业设计论文译文html和xhtml的区别.doc_第3页
第3页 / 共8页
毕业设计论文译文html和xhtml的区别.doc_第4页
第4页 / 共8页
毕业设计论文译文html和xhtml的区别.doc_第5页
第5页 / 共8页
点击查看更多>>
资源描述

1、中原工学院毕业设计(论文)译文专用纸 1Html 和 xhtml 之 间 的 不 同从一开始,是超文本标记语言成就了万维网。它定义了我们在几乎每个网站上看到的页面,并同时传到了页面设计者的思想。像英语、法语、西班牙语、日语、俄语、或任何其他今天依旧被使用的语言一样,它是一个在变化和发展的“ 活”的语言。在早期,这种快速、突然的增长在万维网联盟中带来了“停滞 ”性质的功能。另外, 许多设计师希望设计出渲染更快,结构更松散,内容量更大的网页。如果有些边角被剪掉?这里谈的关键是内容,内容才是最重要的。进入 XHTML,我们可以尝试着通过一些努力,比如为支配万维网中 web 的发展而制造的一种 xml

2、 的“方言”html。XHTML 存在三种不同版本: 过渡的, 严格的,框架的, 每个版本提供不同的功能以及对 xml 不同的符合度。对于单方面问题,也许 html 和 xml 之间最主要的区别就是 XHTML 必须被严格定义。你会说:这没什么大不了的。嗯,可能情况确实是这个样子。这个文档部分,就像脚被附加到额头那样,没有严格定义,却没有明显显现。因为一个 XHTML 文档实际上是 XML,如果简单地遵循 HTML,实践多年之后,我们就会陷入麻烦。中原工学院毕业设计(论文)译文专用纸 2考虑下下面两个 HTML 输入语句:两个 html 输入语句都是完全正确的 html 标签语句,但都由于没有

3、严格定义,所以不符合 xhtml 标准。第一个语句的问题是,在 HTML 中,标签没有结束符是可以的,但同样的问题在 xhtml 中却是被禁止的。第二个语句的问题可能有点难辨识。我将给你一个提示:属性。是的,在 XML,属性必须总是有值的,所以要给它一个值。disabled=“disabled“ ,看起来笨笨的, 但它是能正确运行的。乍一看,似乎要求 HTML 转换成 XHTML,就是在 HTML 标记之前贴一个 DTD,添加上缺少的结束符,清理掉没有赋值的属性。看呀,这就变成 XHTML 了! 好吧,也许, 有时候,偶尔,除了星期二晚上或恰好一个满月,这是对的。你看,不幸的是,这仍然有潜在的

4、问题。中原工学院毕业设计(论文)译文专用纸 3在我创建了第一个 XHTML 页面约5 分钟后我无意中发现了这个问题,, 那时的心情是,我感觉自己被出卖了。问题的根源来自,我在 JavaScript 函数中的比较。与五花八门的连接符(elseif(a = b)alert(a elsealert(b is bigger)/ HTML / XML 注释的目的,是从 HTML 中隐藏掉 CDATA 中的内容。JavaScript 的注释可以防止选择浏览器从而避开有问题的 JavaScript 透视图。虽然他可能看清来并不美观,但是起到的作用很好。The Difference Between HTML

5、and XHTML中原工学院毕业设计(论文)译文专用纸 5From its very beginning, Hypertext Markup Language is what has made the World Wide Web possible. It both conveys the thoughts of the person who created the page and defines nearly every aspect of what we see on each and every web page visited. Like English, French, Spani

6、sh, Japanese, Russian, or any other language in use today, it is a living language, evolving and growing.Early on, this growth was fast and sudden, with “features“ often doing an end-run around the World Wide Web Consortium. Add to that the fact that many of the designers of web pages play fast and

7、loose in an effort to have more content than the next guy. So what if some corners were cut? It was all about content, and content was king.Enter XHTML, considered by some as an effort to reign in the Wild West approach to web development by making HTML a dialect of XML. XHTML came in three flavors:

8、 transitional, strict, and frameset, with each flavor offering either different capabilities or different degrees of conformance to the XML standard.Probably the biggest single difference between HTML and XHTML is that XHTML must be well formed. “Not a big deal,“ you say. Well, it could be. The part

9、 of the document that isnt well formed doesnt have to be glaring, like a foot being attached to the forehead. Because an XHTML document is essentially XML, simply following the HTML practices that weve followed for years is enough to get us into trouble. Consider the following two HTML input stateme

10、nts:中原工学院毕业设计(论文)译文专用纸 6Both statements are perfectly acceptable HTML, but as XHTML, they dont make the grade because neither is well formed. The problem with the first statement is that the tag isnt closedperfectly acceptable in HTML, but verboten in XHTML. Fortunately, correcting it is a simple ma

11、tter; just close the tag in the manner of self-closing tags or treat it as a container tag. The problem with the second statement might be a little harder to spot. Ill give you a hint: attributes. Yes, in XML, attributes must always have values, so give it one. disabled=“disabled“ might look goofy,

12、but it works.At first glance, it might appear that all that is required to convert HTML into XHTML is to slap a DTD before the HTML tag, close some tags, and clean up some attributes. Voil, instant XHTML! Well, maybe, sometimes, occasionally, except on Tuesdays or at night during a full moon. You se

13、e, unfortunately, there is still a potential source of problems.I stumbled on this problem approximately 5 minutes after creating my first XHTML page, and I immediately felt betrayed. The source of the problem was compares in my JavaScript functions. With the assorted compares using ampersand (elseif(a = b)alert(a elsealert(b is bigger)中原工学院毕业设计(论文)译文专用纸 8/ The purpose of the HTML/XML comments is to hide the CDATA section from HTML. The JavaScript comment prevents select browsers from having issues from a JavaScript perspective. Although it might not be pretty to look at, it does work well.

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 学术论文资料库 > 毕业论文

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。