xhtml出牙的烦恼 [英] xhtml teething troubles

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

问题描述

此页
http:// homepage.ntlworld.com/ramcc..._local_dtd.xml

在Firefox或IE6中无法正常工作。故障是不同的。在

Firefox中,无法识别TestText实体。在IE6中,< br />标签

不会导致换行。谁能告诉我我做错了什么?

解决方案

Ted写道:

这个页面
http://homepage.ntlworld.com /ramcc..._local_dtd.xml
在Firefox或IE6中无法正常工作。故障是不同的。
在Firefox中,无法识别TestText实体。在IE6中,< br />
标记不会导致换行符。任何人都可以告诉我我在做什么
错误?



正如你所说,DTD是本地的;我无法检查它。您可能会或可能不会
已定义这些实体。考虑在内联DTD

子集中定义它们;你不能指望浏览器获取你的DTD。


-

杰克。


< blockquote>

Ted写道:

这个页面
http://homepage.ntlworld.com/ramcc..._local_dtd.xml
在Firefox或IE6中无法正常工作。故障是不同的。在Firefox中,无法识别TestText实体。在IE6中,< br />标签
不会导致换行。谁能告诉我我做错了什么?



首先,在IE6中支持的XHTML并不是很好。您还必须验证您的XHTML,这对于获取浏览器需要很长时间才能正确显示您的代码。

另外,使用一个合适的XHTML严格文档类型,因为它会更好

被浏览器识别。

-

关心Chad。 http://freewebdesign.cjb.cc




Ted写道:

http://homepage.ntlworld.com/ramcc..._local_dtd.xml
在Firefox或IE6中无法正常工作。故障是不同的。在Firefox中,无法识别TestText实体。


正确 - 因为Firefox目前无法获取任何类型的外部DTD'

。请参阅< https://bugzilla.mozilla.org/show_bug.cgi?id = 35984>

和outsprings。一个非常讨厌的bug迫使在内部DTD中声明所有额外的实体

,例如

<!DOCTYPE模板[

<!ENTITY nbsp ; ">

...等

]>


注意:没有本地DTD作为一个术语。有外部DTD(你的

案例)和内部DTD(我的样本)。

在IE6中,< br />标签不会导致换行。




因为默认XML命名空间中的XML文档对于< br没有特殊的

处理/> - 它只是一个结构良好的元素,没有关闭标签。

它意味着对HTML解析器很重要(比如make line break

here) ),但静音为XML。


在XSL模板中使用您的模板并将其链接到XML数据文件,因此

结果页面将是HTML。简单地说:停止/黑客/事情并开始

/使用/他们;-)

< comp.text.xml>是另一个很好的帮助来源。


This page
http://homepage.ntlworld.com/r.a.mcc..._local_dtd.xml
doesn''t work properly in Firefox or IE6. The faults are different. In
Firefox the TestText entity is not recognised. In IE6, the <br /> tag
doesn''t cause a line break. Can anyone tell me what I''m doing wrong?

解决方案

Ted wrote:

This page
http://homepage.ntlworld.com/r.a.mcc..._local_dtd.xml
doesn''t work properly in Firefox or IE6. The faults are different.
In Firefox the TestText entity is not recognised. In IE6, the <br />
tag doesn''t cause a line break. Can anyone tell me what I''m doing
wrong?


As you say, the DTD is local; I can''t inspect it. You may or may not
have defined those entities. Consider defining them in an inline DTD
subset; you can''t count on the browser fetching your DTD.

--
Jack.



Ted wrote:

This page
http://homepage.ntlworld.com/r.a.mcc..._local_dtd.xml
doesn''t work properly in Firefox or IE6. The faults are different. In
Firefox the TestText entity is not recognised. In IE6, the <br /> tag
doesn''t cause a line break. Can anyone tell me what I''m doing wrong?


For a start, the XHTML support inIE6 is not very good. You also must
validate your XHTML, that should go a long way in getting the browsers
to display your code correctly.
Also, use a proper XHTML Strict Doc Type as that will be better
recognized by browsers.
--
Regards Chad. http://freewebdesign.cjb.cc



Ted wrote:

http://homepage.ntlworld.com/r.a.mcc..._local_dtd.xml
doesn''t work properly in Firefox or IE6. The faults are different. In
Firefox the TestText entity is not recognised.
Right - because Firefox currently is not able to fetch external DTD''s
of any kind. See <https://bugzilla.mozilla.org/show_bug.cgi?id=35984>
and outsprings. A very nasty bug forcing to declare all extra entities
in internal DTD like
<!DOCTYPE template [
<!ENTITY nbsp " ">
... etc
]>

Note: there is no "local DTD" as a term. There is external DTD (your
case) and internal DTD (my sample).
In IE6, the <br /> tag doesn''t cause a line break.



Because an XML document in default XML namespace has no special
treatment for <br /> - it''s just a well-formed element w/o closing tag.
It meay mean something important to HTML parser (like "make line break
here"), but mute to XML.

Use your template in XSL template and link it to XML data file so the
resulting page would be HTML. Briefly: stop /hacking/ things and start
/using/ them ;-)

<comp.text.xml> is another good source of help on the matter.


这篇关于xhtml出牙的烦恼的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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