Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
463 views
in Technique[技术] by (71.8m points)

html - Without internet connection, how xmlns attribute can work and understand by browser?

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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...