没有互联网连接,xmlns属性如何通过浏览器工作和理解? [英] Without internet connection, how xmlns attribute can work and understand by browser?

查看:147
本文介绍了没有互联网连接,xmlns属性如何通过浏览器工作和理解?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的XHTML文档,具有所需的最小标记: xmlns 属性具有http链接。

如果我正在处理localhost,如果我没有互联网连接,我无法使用XHTML吗?

 < html xmlns =http://www.w3.org/1999/xhtml> 
< head>
< title>文件的标题< / title>
< / head>

< body>
文件的内容......
< / body>

< / html>


解决方案

XML命名空间就是基于一个命名空间,它恰好是URI格式的。请参阅 XML命名空间规范。在这种情况下, http://www.w3.org/1999/xhtml 是XHTML的命名空间; XML处理器将能够使用这些信息来标识XHTML名称空间中的哪些元素(由该URL标识)。



浏览器不会尝试请求 xmlns 属性中列出的URL。即使这样做,它也不会收到任何有用的东西;请在浏览器中访问 http://www.w3.org/1999/xhtml ,然后亲自查看。

所以即使你在一台没有互联网连接的开发机器上工作,也没有什么可担心的。您仍然可以编写有效的XHTML。


A simple XHTML document, with the minimum of required tags: and xmlns attribute has a http link.

If I am working on localhost and if I don't have an Internet connection, can't I work on XHTML?

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Title of the document</title>
    </head>

    <body>
        The content of the document......
    </body>

</html>

解决方案

The XML namespace is just there to identify elements based on a namespace, which happens to be in a URI format. See the XML Namespaces spec. In this case, http://www.w3.org/1999/xhtml is the namespace for XHTML; an XML processor will be able to use this information to identify which elements are in the XHTML namespace (identified by that URL).

The browser isn't going to attempt to request the URL that's listed in the xmlns attribute. Even if it does, it won't receive anything useful anyway; visit http://www.w3.org/1999/xhtml in your browser and see for yourself.

So there's nothing to worry about, even if you're working on a development machine with no Internet connection. You'll still be able to write valid XHTML.

这篇关于没有互联网连接,xmlns属性如何通过浏览器工作和理解?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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