我将跳上XHTML的潮流 [英] I shall jump on the XHTML bandwagon

查看:49
本文介绍了我将跳上XHTML的潮流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将跳上XHTML的潮流。

我运行完美的html4 /严格页面通过

$ tidy -asxhtml -utf8 #to get:

<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.0 Strict // EN"

" http://www.w3.org/TR/xhtml1 /DTD/xhtml1-strict.dtd"> < html

xmlns =" http://www.w3.org/1999/xhtml"> < head>< meta

http-equiv =" Content-Type"含量=" text / html的;字符集= UTF-8英寸/> < meta

http-equiv =" Content-Language"含量=" ZH-TW" />

一直都知道 http:// hixie。 ch / advocacy / xhtml 说,

我所做的就是将我的页面从html4 / strict.dtd降级为

怪癖模式......(我假设有一天,一些白马王子的浏览器将会出现并且检测到所有这些,这将有一些实际的好处。)


我不会使用任何.htaccess我的网络主机上的文件。对我来说,没有更多单一的

失败点。无论如何,如果从file:///或
,我的页面看起来都是一样的。 target =_ blank> http://。



此外,我仍然会使用相同的.html文件名而不是

.. xhtml,因为我不想打破每个人与我的联系。 (我

明白一个人需要.xhtml和

content =" application / xhtml + xml ..."在例如firefox中触发任何

XHTML治疗。我远非如此。)


对于我的英文页面,尽管我仍然可以宣布ISO-8859-1,但是我是

应声明utf-8,是现代的等等。


所以我想我唯一的问题是:

我应该担心
http://www.yourhtmlsource.com/access .. .xmldeclaration

或继续使用整齐的--add-xml-decl 1,产生一个

<?xml version =" 1.0" ?>或者更好地添加

<?xml version =" 1.0" encoding =" UTF-8"?>

UTF-8或utf-8?


虽然整洁不行,但我还能继续吗?并打扰

< html xmlns =" ..."郎= QUOT; ZH-TW" XML:朗= QUOT; ZH-TW"> lang stuff,或者是我的

http-equiv line aboveequiv够了吗?

I shall jump on the XHTML bandwagon.
I run my perfectly good html4/strict pages thru
$ tidy -asxhtml -utf8 #to get:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html
xmlns="http://www.w3.org/1999/xhtml"> <head><meta
http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta
http-equiv="Content-Language" content="zh-tw" />
knowing all the time as http://hixie.ch/advocacy/xhtml says,
that all I am doing is downgrading my pages from html4/strict.dtd to
quirks mode... (I suppose one day some Prince Charming browser will
come along and detect all this so there will be some actual benefit.)

I will not use any .htaccess files on my web host. No more single
point of failures for me. Anyway my pages are to look the same if read
from file:/// or http://.

Furthermore, I will still use their same .html filenames and not
..xhtml, as I don''t want to break everybody''s links to me. (I
understand that one needs .xhtml and
content="application/xhtml+xml..." in e.g., firefox to trigger any
XHTML treatment. I am thus far from that.)

For my English pages, even though I could still declare ISO-8859-1, I
shall declare utf-8, being modern and such.

So I suppose my only questions are:
Shall I fear the old browsers of
http://www.yourhtmlsource.com/access...xmldeclaration
or go ahead and use tidy --add-xml-decl 1, producing a
<?xml version="1.0"?> or better yet add
<?xml version="1.0" encoding="UTF-8"?>
UTF-8 or utf-8?

Though tidy doesn''t, shall I still proceed and bother with the
<html xmlns="..." lang="zh-tw" xml:lang="zh-tw"> lang stuff, or is my
http-equiv line above "equiv" enough?

推荐答案

tidy -asxhtml -utf8 #to get:

<!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Strict // EN"

" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> < html

xmlns =" http://www.w3.org/1999/xhtml"> < head>< meta

http-equiv =" Content-Type"含量=" text / html的;字符集= UTF-8英寸/> < meta

http-equiv =" Content-Language"含量=" ZH-TW" />

一直都知道 http:// hixie。 ch / advocacy / xhtml 说,

我所做的就是将我的页面从html4 / strict.dtd降级为

怪癖模式......(我假设有一天,一些白马王子的浏览器将会出现并且检测到所有这些,这将有一些实际的好处。)


我不会使用任何.htaccess我的网络主机上的文件。对我来说,没有更多单一的

失败点。无论如何,如果从file:///或
,我的页面看起来都是一样的。 target =_ blank> http://。



此外,我仍然会使用相同的.html文件名而不是

.. xhtml,因为我不想打破每个人与我的联系。 (我

明白一个人需要.xhtml和

content =" application / xhtml + xml ..."在例如firefox中触发任何

XHTML治疗。我远非如此。)


对于我的英文页面,尽管我仍然可以宣布ISO-8859-1,但是我是

应声明utf-8,是现代的等等。


所以我想我唯一的问题是:

我应该担心
http://www.yourhtmlsource.com/access .. .xmldeclaration

或继续使用整齐的--add-xml-decl 1,产生一个

<?xml version =" 1.0" ?>或者更好地添加

<?xml version =" 1.0" encoding =" UTF-8"?>

UTF-8或utf-8?


虽然整洁不行,但我还能继续吗?并打扰

< html xmlns =" ..."郎= QUOT; ZH-TW" XML:朗= QUOT; ZH-TW"> lang stuff,或者是我的

http-equiv line aboveequiv足够吗?

tidy -asxhtml -utf8 #to get:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html
xmlns="http://www.w3.org/1999/xhtml"> <head><meta
http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta
http-equiv="Content-Language" content="zh-tw" />
knowing all the time as http://hixie.ch/advocacy/xhtml says,
that all I am doing is downgrading my pages from html4/strict.dtd to
quirks mode... (I suppose one day some Prince Charming browser will
come along and detect all this so there will be some actual benefit.)

I will not use any .htaccess files on my web host. No more single
point of failures for me. Anyway my pages are to look the same if read
from file:/// or http://.

Furthermore, I will still use their same .html filenames and not
..xhtml, as I don''t want to break everybody''s links to me. (I
understand that one needs .xhtml and
content="application/xhtml+xml..." in e.g., firefox to trigger any
XHTML treatment. I am thus far from that.)

For my English pages, even though I could still declare ISO-8859-1, I
shall declare utf-8, being modern and such.

So I suppose my only questions are:
Shall I fear the old browsers of
http://www.yourhtmlsource.com/access...xmldeclaration
or go ahead and use tidy --add-xml-decl 1, producing a
<?xml version="1.0"?> or better yet add
<?xml version="1.0" encoding="UTF-8"?>
UTF-8 or utf-8?

Though tidy doesn''t, shall I still proceed and bother with the
<html xmlns="..." lang="zh-tw" xml:lang="zh-tw"> lang stuff, or is my
http-equiv line above "equiv" enough?


Dan Jacobson写道:
Dan Jacobson wrote:
我将跳上XHTML的潮流。


请不要 - 因为text / html,充其量只是愚蠢的。使用适当的

内容类型,它几乎不受浏览器的支持,并且对文本/ html文档的支持通常比

更差(例如告别

document.write和Firefox中的增量渲染)。

我所做的就是将我的页面从html4 / strict.dtd降级为
怪癖模式...(我想一个有一天,一些白马王子的浏览器会出现并检测到这一切,这样就会有一些实际的好处。)


所以这个浏览器会检查文档格式是否格式正确,然后通过XML解析器而不是标签汤傻瓜推送它?b $ b?听起来很多

的工作......没有任何好处。

此外,我仍然会使用相同的.html文件名,而不是
.xhtml,我不想打破每个人与我的联系。 (我明白需要.xhtml和
content =" application / xhtml + xml ..."在例如firefox中触发任何
XHTML处理。我远非如此那个。)


不会。对于本地文件,我相信Firefox会关注文件扩展名,

只针对远程文件的HTTP头中的内容类型计数。 Meta

数据仅用于在网络服务器失败时找出字符编码

来指定它。

对于我的英文页面,即使我仍然可以宣布ISO-8859-1,我将声明utf-8,是现代的等等。


有些人可能会在英语语言文件中使用这些字符

在ISO-8859-1和UTF-8中有不同的位置。不要对你的

内容类型撒谎。

所以我想我唯一的问题是:
我是否害怕
的旧浏览器< a rel =nofollowhref =http://www.yourhtmlsource.com/accessibility/xhtmlexplained.html#xmldeclaration\"target =_ blank> http://www.yourhtmlsource.com/access...xmldeclaration 或继续使用整齐的--add-xml-decl 1,产生一个
<?xml version =" 1.0"?>或者更好的是添加
<?xml version =" 1.0"编码= QUOT; UTF-8英寸;?>


text / html规范说XHTML 1.0定义了一个使用XHTML的配置文件

,它与HTML 4.01兼容,也可能标记为

text / html。 XHTML 1.0规范的附录C(这是HTML

兼容性[1]指南)说你不应该包含XML序言。

因此< ?xml等?>在文本/ html文档中没有位置。

虽然整洁无所事事,但我还是要继续打扰
< html xmlns =" ..."郎= QUOT; ZH-TW" XML:朗= QUOT; ZH-TW"> lang stuff,或者是我的
http-equiv line以上equiv足够吗?
I shall jump on the XHTML bandwagon.
Please don''t - as text/html it is, at best, silly. With the proper
content-type it enjoys little support from browsers, and support is
generally worse then for text/html documents (e.g. say goodbye to
document.write and incremental rendering in Firefox).
that all I am doing is downgrading my pages from html4/strict.dtd to
quirks mode... (I suppose one day some Prince Charming browser will
come along and detect all this so there will be some actual benefit.)
So this browser will check that the document is well formed XML, then push
it through an XML parser instead of a tag soup slurper? Sounds like a lot
of work for ... no benefit.
Furthermore, I will still use their same .html filenames and not
.xhtml, as I don''t want to break everybody''s links to me. (I
understand that one needs .xhtml and
content="application/xhtml+xml..." in e.g., firefox to trigger any
XHTML treatment. I am thus far from that.)
No. For local files I believe Firefox pays attention to the file extensions,
for remote files only the content-type in the HTTP header counts. The Meta
data is used only to find out the character encoding when webservers fail
to specify it.
For my English pages, even though I could still declare ISO-8859-1, I
shall declare utf-8, being modern and such.
There are characters that one might use in an English language document that
have different locations in ISO-8859-1 and UTF-8. Don''t lie about your
content type.
So I suppose my only questions are:
Shall I fear the old browsers of
http://www.yourhtmlsource.com/access...xmldeclaration or go ahead and use tidy --add-xml-decl 1, producing a
<?xml version="1.0"?> or better yet add
<?xml version="1.0" encoding="UTF-8"?>
The text/html spec says that XHTML 1.0 defines a profile of use of XHTML
which is compatible with HTML 4.01 and which may also be labelled as
text/html. Appendix C of the XHTML 1.0 spec (which is the HTML
compatibility[1] guidelines) says that you shouldn''t include an XML prolog.
Thus an <?xml etc ?> has no place in a text/html document.
Though tidy doesn''t, shall I still proceed and bother with the
<html xmlns="..." lang="zh-tw" xml:lang="zh-tw"> lang stuff, or is my
http-equiv line above "equiv" enough?




http-equiv也是个玩笑。使用真实内容类型标头。在用作text / html的文档中使用lang

属性。在XML中使用xml:lang属性

文档。


只是避免向客户提供XHTML,目前它完全没有意义。


[1]这是个玩笑。它只会使*与大多数*浏览器中的HTML实现完全兼容

。如果用户代理根据HTML规范处理text / html文档中的< img />

,则会出现问题。


-

David Dorward< http://blog.dorward.me.uk/> < http://dorward.me.uk/>

Home是〜/ .bashrc的地方



http-equiv is also a joke. Use a real content type header. Use a lang
attribute in documents served as text/html. Use a xml:lang attribute in XML
documents.

Just avoid serving XHTML to clients, it is utterly pointless at present.

[1] This is a joke. It only makes it compatible with broken implementations
of HTML in *most* browsers. You get problems if a user agent treats <img />
in a text/html document as per the HTML specs.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Dan Jacobson写道:
Dan Jacobson wrote:
我将跳上XHTML的潮流。
I shall jump on the XHTML bandwagon.




我邀请你查看我的页面.....

http://jp29.org/test.php



I invite you to check out my page .....

http://jp29.org/test.php


这篇关于我将跳上XHTML的潮流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆