本文介绍了xhtml出牙的烦恼的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 此页 http:// homepage.ntlworld.com/ramcc..._local_dtd.xml 在Firefox或IE6中无法正常工作。故障是不同的。在 Firefox中,无法识别TestText实体。在IE6中,< br />标签 不会导致换行。谁能告诉我我做错了什么? 解决方案 正如你所说,DTD是本地的;我无法检查它。您可能会或可能不会已定义这些实体。考虑在内联DTD 子集中定义它们;你不能指望浏览器获取你的DTD。 - 杰克。 Ted写道: 首先,在IE6中支持的XHTML并不是很好。您还必须验证您的XHTML,这对于获取浏览器需要很长时间才能正确显示您的代码。 另外,使用一个合适的XHTML严格文档类型,因为它会更好 被浏览器识别。 - 关心Chad。 http://freewebdesign.cjb.cc 因为默认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.xmldoesn''t work properly in Firefox or IE6. The faults are different. InFirefox the TestText entity is not recognised. In IE6, the <br /> tagdoesn''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 nothave defined those entities. Consider defining them in an inline DTDsubset; you can''t count on the browser fetching your DTD.--Jack.For a start, the XHTML support inIE6 is not very good. You also mustvalidate your XHTML, that should go a long way in getting the browsersto display your code correctly.Also, use a proper XHTML Strict Doc Type as that will be betterrecognized by browsers.--Regards Chad. http://freewebdesign.cjb.ccBecause an XML document in default XML namespace has no specialtreatment for <br /> - it''s just a well-formed element w/o closing tag.It meay mean something important to HTML parser (like "make line breakhere"), but mute to XML.Use your template in XSL template and link it to XML data file so theresulting 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出牙的烦恼的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-22 14:34