问题包括xhtml下的文件 [英] problem including files under xhtml

查看:51
本文介绍了问题包括xhtml下的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以提供建议,为什么,在同一台服务器上(Apache 2.2.8),

这是有效的


<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN">

< html lang =" en-US">

< head>

< link rel = stylesheet type =" text / css" href =" proj_default.css"

title =" ss_default">

< title>测试html< / title>

< / head>


< body>

< script language =" php">

include' 'letters / Disclaimer'';

< / script>

< hr>

< address>< a href =" mailto:ro ******** @ rcn.com"> Robert Huff< / a>< / address>

<! - 创建时间:周三1月19日美国东部时间2005年10:52:50 - >

<! - hhmts start - >

修订:Mon Jun 2 16:56: 19 EDT 2008

<! - hhmts end - >

< / body>

< / html>

但这不是:

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

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

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

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

< head>

< title>测试xhtml< / title>

< link rel ="样式表"类型= QUOT;文本/ CSS" href =" proj_default.css"

title =" ss_default" />

< link rel =" icon" type =" image / x-icon"

href =" images / favicon.png" />

< link rel ="快捷方式图标" type =" image / x-icon"

href =" images / favicon.png" />

< / head>


< body>

< script type =" text / php" ;>

包括''字母/免责声明'';

< / script>

< hr />

< address>< a href =" mailto:ro ******** @ rcn.com"> Robert Huff< / a>< / address>

<! - 创建时间:1月19日星期三美国东部时间2005年10月5日10:52:>

<! - hhmts start - >

最后修改时间:2008年1月2日星期一17:37:52

<! - hhmts end - >

< / body>

< / html>

" Works"被定义为发送到

浏览器的信件内容/免责声明。

恭敬地,

Robert Huff


解决方案

2008年6月3日星期二00:16:50 +0200,Robert Huff< ro ******* *@rcn.comwrote:


有人可以提供建议,为什么,在同一台服务器上(Apache 2.2.8),

这个工作


<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN">

< html lang =" zh -US">

< head>

< link rel = stylesheet type =" text / css" href =" proj_default.css"

title =" ss_default">

< title>测试html< / title>

< / head>


< body>

< script language =" php">

include' 'letters / Disclaimer'';

< / script>

< hr>

< address>< a href =" mailto:ro ******** @ rcn.com"> Robert Huff< / a>< / address>

<! - 创建时间:周三1月19日美国东部时间2005年10:52:50 - >

<! - hhmts start - >

修订:Mon Jun 2 16:56: 19 EDT 2008

<! - hhmts end - >

< / body>

< / html>


但这不是:

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

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

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

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

< head>

< title>测试xhtml< / title>

< link rel ="样式表"类型= QUOT;文本/ CSS" href =" proj_default.css"

title =" ss_default" />

< link rel =" icon" type =" image / x-icon"

href =" images / favicon.png" />

< link rel ="快捷方式图标" type =" image / x-icon"

href =" images / favicon.png" />

< / head>


< body>

< script type =" text / php" ;>

包括''字母/免责声明'';

< / script>

< hr />

< address>< a href =" mailto:ro ******** @ rcn.com"> Robert Huff< / a>< / address>

<! - 创建时间:1月19日星期三美国东部时间2005年10月5日10:52:>

<! - hhmts start - >

最后修改时间:2008年1月2日星期一17:37:52

<! - hhmts end - >

< / body>

< / html>


" Works"被定义为发送到

浏览器的信件内容/免责声明。




< script language =" php"< / script>

vs.

< script type =" text / php"< / script>


....一个有效,另一个没有。就个人而言,我只使用<?php?> ;.


除此之外,由于您似乎尝试使用XHTML,手册指出:

注意:另外请注意,如果您在PHP或XHTML中嵌入PHP,您将需要使用<?php?标签来保持符合标准。

-

Rik Wasmus

.... spamrun完成


Rik Wasmus写道:


>有人可以提供建议,为什么,在同一台服务器上(Apache
2.2.8),这是有效的

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN">
< html lang =" zh-CN">
< head>
< link rel = stylesheet type =" text / css" href =" proj_default.css"
title =" ss_default">
< title>测试html< / title>
< / head>
< body>
< script language =" php">
包含''信件/免责声明'';
< / script>

< hr>
< address>< a href =" mailto:ro ******** @ rcn.com"> Robert Huff< / a>< / address>
<! - 创建时间:1月19日星期三美国东部时间2005年10月15日10:52:>
<! - hhmts start - >
最后修改时间:星期一6月2日16: 56:19 EDT 2008
<! - hhmts end - >
< / body>
< / html>

但这不是' 't:
<?xml version =" 1.0" encoding =" utf-8"?>
<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.1 // EN"
" http://www.w3。 org / TR / xhtml1 / DTD / xhtml1-strict.dtd">
< html xmlns =" http://www.w3.org/1999/xhtml">
< head> ;
< title>测试xhtml< / title>
< link rel =" stylesheet"类型= QUOT;文本/ CSS" href =" proj_default.css"
title =" ss_default" />
< link rel =" icon" type =" image / x-icon"
href =" images / favicon.png" />
< link rel ="快捷方式图标" type =" image / x-icon"
href =" images / favicon.png" />
< / head>

< body>
< script type =" text / php">
包含''字母/免责声明'';
< / script>
< hr />
< address>< a href =" mailto:ro ******** @ rcn.com">罗伯特赫夫< / a>< /地址>
<! - 创建时间:1月19日星期三,东部时间2005年10月5日10:52: - >
<! - - hhmts start - >
最后修改时间:星期一2月2日17:37:52美国东部时间2008
<! - hhmts end - >
< / body>
< / html>

" Works"被定义为将信件的内容/免责声明发送给浏览器。



< script language =" php"< / script>

vs.

<脚本类型=" text / php"< / script>


...一个有用,另一个没有。就个人而言,我只使用<?php?>。



" language"不是XHTML< script>的合法属性。 (或者说是
W3C验证器。)


除此之外,当您尝试使用XHTML时,手册指出:

注意:另请注意,如果您在PHP或XHTML中嵌入PHP,那么
将需要使用<?php?标记以保持符合标准。



我理解这意味着:


在XML或XHTML中使用PHP时,标签<? ?>"不会是b $ b工作;相反,你必须使用<?php?>。


......但我可能错了。你有指向文档的指针

声明"< script>" verboten?

Robert Huff


6月2日下午5:16,Robert Huff< roberth ... @ rcn.comwrote:


有人可以提供建议,为什么,在同一台服务器上(Apache 2.2.8),

这是有效的


<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN">

< html lang =" en-US">

< head>

< link rel = stylesheet type =" text / css" href =" proj_default.css"

title =" ss_default">

< title>测试html< / title>

< / head>


< body>

< script language =" php">

include' 'letters / Disclaimer'';

< / script>

< hr>

< address>< a href =" mailto:roberth ... @ rcn.com"> Robert Huff< / a>< / address>

<! - 创建时间:1月19日星期三10:52 :50 EST 2005 - >

<! - hhmts start - >

修订:2008年1月2日星期一16:56:19 />
<! - hhmts end - >

< / body>

< / html>

但这不是:

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

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

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

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

< head>

< title>测试xhtml< / title>

< link rel ="样式表"类型= QUOT;文本/ CSS" href =" proj_default.css"

title =" ss_default" />

< link rel =" icon" type =" image / x-icon"

href =" images / favicon.png" />

< link rel ="快捷方式图标" type =" image / x-icon"

href =" images / favicon.png" />

< / head>


< body>

< script type =" text / php" ;>

包括''字母/免责声明'';

< / script>

< hr />

< address>< a href =" mailto:roberth ... @ rcn.com"> Robert Huff< / a>< / address>

< ! - 创建时间:1月19日星期三美国东部时间2005年10月5日10:52:50>

<! - hhmts start - >

最后修改:星期一2008年6月2日17:37:52

<! - hhmts end - >

< / body>

< ; / html>


" Works"被定义为发送到

浏览器的信件内容/免责声明。



首先两个页面代码都无效。如果您复制每页

的代码并将它们带到W3C验证器,您可以直接在文本框中输入代码

。对于html 4.01,您必须使用< script

type =" text / javascript">。仅使用语言,或者根本不使用html 4.01和所有更高版本中的错误

。但是,据我所知,所有

最近流行的浏览器都会在html 4.01中原谅这个错误。在页面的两个
上,你写下最后修改过的文字 - 。在段落等容器中不包含

。这是所有上述版本的html 4.01和

中的错误。然而,最受欢迎的最新浏览器将原谅

这个错误在html 4.01中。所以我并不感到惊讶你的html 4.01

页面至少可以在大多数浏览器上运行。


对于xhtml 1.1页面,有一个错误, <


Can someone offer suggestions why, on the same server (Apache 2.2.8),
this works

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en-US">
<head>
<link rel=stylesheet type="text/css" href="proj_default.css"
title="ss_default">
<title>Testing html</title>
</head>

<body>
<script language="php">
include ''letters/Disclaimer'';
</script>

<hr>
<address><a href="mailto:ro********@rcn.com">Robert Huff</a></address>
<!-- Created: Wed Jan 19 10:52:50 EST 2005 -->
<!-- hhmts start -->
Last modified: Mon Jun 2 16:56:19 EDT 2008
<!-- hhmts end -->
</body>
</html>
but this doesn''t:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing xhtml</title>
<link rel="stylesheet" type="text/css" href="proj_default.css"
title="ss_default" />
<link rel="icon" type="image/x-icon"
href="images/favicon.png" />
<link rel="shortcut icon" type="image/x-icon"
href="images/favicon.png" />
</head>

<body>
<script type="text/php">
include ''letters/Disclaimer'';
</script>
<hr />
<address><a href="mailto:ro********@rcn.com">Robert Huff</a></address>
<!-- Created: Wed Jan 19 10:52:50 EST 2005 -->
<!-- hhmts start -->
Last modified: Mon Jun 2 17:37:52 EDT 2008
<!-- hhmts end -->
</body>
</html>
"Works" is defined as "the contents of letters/Disclaimer sent to the
browser".
Respectfully,
Robert Huff


解决方案

On Tue, 03 Jun 2008 00:16:50 +0200, Robert Huff <ro********@rcn.comwrote:

Can someone offer suggestions why, on the same server (Apache 2.2.8),
this works

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en-US">
<head>
<link rel=stylesheet type="text/css" href="proj_default.css"
title="ss_default">
<title>Testing html</title>
</head>

<body>
<script language="php">
include ''letters/Disclaimer'';
</script>

<hr>
<address><a href="mailto:ro********@rcn.com">Robert Huff</a></address>
<!-- Created: Wed Jan 19 10:52:50 EST 2005 -->
<!-- hhmts start -->
Last modified: Mon Jun 2 16:56:19 EDT 2008
<!-- hhmts end -->
</body>
</html>
but this doesn''t:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing xhtml</title>
<link rel="stylesheet" type="text/css" href="proj_default.css"
title="ss_default" />
<link rel="icon" type="image/x-icon"
href="images/favicon.png" />
<link rel="shortcut icon" type="image/x-icon"
href="images/favicon.png" />
</head>

<body>
<script type="text/php">
include ''letters/Disclaimer'';
</script>
<hr />
<address><a href="mailto:ro********@rcn.com">Robert Huff</a></address>
<!-- Created: Wed Jan 19 10:52:50 EST 2005 -->
<!-- hhmts start -->
Last modified: Mon Jun 2 17:37:52 EDT 2008
<!-- hhmts end -->
</body>
</html>
"Works" is defined as "the contents of letters/Disclaimer sent to the
browser".



<script language="php"</script>
vs.
<script type="text/php"</script>

.... one works, the other one doesn''t. Personally, I only use <?php ?>.

Besides that, as you seem to attemp XHTML, the manual states:
Note: Also note that if you are embedding PHP within XML or XHTML you will
need to use the <?php ?tags to remain compliant with standards.
--
Rik Wasmus
....spamrun finished


Rik Wasmus wrote:

> Can someone offer suggestions why, on the same server (Apache
2.2.8), this works

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en-US">
<head>
<link rel=stylesheet type="text/css" href="proj_default.css"
title="ss_default">
<title>Testing html</title>
</head>

<body>
<script language="php">
include ''letters/Disclaimer'';
</script>

<hr>
<address><a href="mailto:ro********@rcn.com">Robert Huff</a></address>
<!-- Created: Wed Jan 19 10:52:50 EST 2005 -->
<!-- hhmts start -->
Last modified: Mon Jun 2 16:56:19 EDT 2008
<!-- hhmts end -->
</body>
</html>
but this doesn''t:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing xhtml</title>
<link rel="stylesheet" type="text/css" href="proj_default.css"
title="ss_default" />
<link rel="icon" type="image/x-icon"
href="images/favicon.png" />
<link rel="shortcut icon" type="image/x-icon"
href="images/favicon.png" />
</head>

<body>
<script type="text/php">
include ''letters/Disclaimer'';
</script>
<hr />
<address><a href="mailto:ro********@rcn.com">Robert Huff</a></address>
<!-- Created: Wed Jan 19 10:52:50 EST 2005 -->
<!-- hhmts start -->
Last modified: Mon Jun 2 17:37:52 EDT 2008
<!-- hhmts end -->
</body>
</html>
"Works" is defined as "the contents of letters/Disclaimer sent to
the browser".


<script language="php"</script>
vs.
<script type="text/php"</script>

... one works, the other one doesn''t. Personally, I only use <?php ?>.

"language" is not a legal attribute for XHTML <script>. (Or so says
the W3C validator.)

Besides that, as you seem to attempt XHTML, the manual states:
Note: Also note that if you are embedding PHP within XML or XHTML you
will need to use the <?php ?tags to remain compliant with standards.

It is my understanding this means:

When using PHP within XML or XHTML, the tags "<? ?>" will not
work; instead you must use "<?php ?>".

... but I could be wrong. Do you have a pointer to documentation
declaring "<script>" verboten?
Robert Huff


On Jun 2, 5:16 pm, Robert Huff <roberth...@rcn.comwrote:

Can someone offer suggestions why, on the same server (Apache 2.2.8),
this works

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en-US">
<head>
<link rel=stylesheet type="text/css" href="proj_default.css"
title="ss_default">
<title>Testing html</title>
</head>

<body>
<script language="php">
include ''letters/Disclaimer'';
</script>

<hr>
<address><a href="mailto:roberth...@rcn.com">Robert Huff</a></address>
<!-- Created: Wed Jan 19 10:52:50 EST 2005 -->
<!-- hhmts start -->
Last modified: Mon Jun 2 16:56:19 EDT 2008
<!-- hhmts end -->
</body>
</html>

but this doesn''t:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing xhtml</title>
<link rel="stylesheet" type="text/css" href="proj_default.css"
title="ss_default" />
<link rel="icon" type="image/x-icon"
href="images/favicon.png" />
<link rel="shortcut icon" type="image/x-icon"
href="images/favicon.png" />
</head>

<body>
<script type="text/php">
include ''letters/Disclaimer'';
</script>
<hr />
<address><a href="mailto:roberth...@rcn.com">Robert Huff</a></address>
<!-- Created: Wed Jan 19 10:52:50 EST 2005 -->
<!-- hhmts start -->
Last modified: Mon Jun 2 17:37:52 EDT 2008
<!-- hhmts end -->
</body>
</html>

"Works" is defined as "the contents of letters/Disclaimer sent to the
browser".

First neither page code is valid. If you copy the codes for each of
the pages and take them to the W3C validator, you can enter the code
directly into a text box. For the html 4.01, you must use <script
type="text/javascript">. Using language only, or at all, is an error
in html 4.01 and all higher versions. However, so far as I know, all
recent popular browsers will forgive this error in html 4.01. On both
of your pages, you write text "last modified --" that is not contained
in a container such as a paragraph. This is an error in html 4.01 and
all above versions. However most popular recent browsers will forgive
this error in html 4.01. So I am not surprised that your html 4.01
page will work on at least most browsers.

For the xhtml 1.1 page, there is a error that the <


这篇关于问题包括xhtml下的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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