What does "xmlns: v = urn: schemas-microsoft-com" mean in HTML5?

I was able to find the sentence "xmlns: v = urn: schemas-microsoft-com" as described in the title

Here is a source approximately.

<!--[if gt IE 8]><!DOCTYPE html><!--<![endif]-->
<!DOCTYPE html><!--<![endif]-->
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><br>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <meta name="viewport" content="user-scalable=0,target-densitydpi=device-dpi">
        ...
    </head>
    <body>
        ...
    </body>
</html>

      

As I know xmlns is a schema, so to speak, metadata. If any element is available in the body section, the metadata for that element exists in "schemas.microsft.com"

If I design an html page using the "microsoft" schema all elements used in the body section will refer to "microsoft" Or if I use a different schema consider "google" (I don't know if this actually exists) all the elements are the same too.

Here is my question First, If I use a table tag that exists in the "microsoft" and "google" schema together, Will Chrome interpret the context differently? so what looks different?

Second, if xmlns is omitted, what is the default schema?

+3


source to share


2 answers


The xmlns: * attributes are namespace definitions. Elements and attributes prefixed / aliased with "v" or "o" are part of the corresponding namespace, not part of HTML. If parsed as HTML <5 namespaces will be ignored. In HTML 5, there are some constructs for specific namespaces (SVG, MathML), but namespace definitions (xmlns: * attributes) are ignored.

When parsed as XML, attributes define namespaces. You have definitions:

  • Alias v

    for urn:schemas-microsoft-com:vml

    - Markup Language
  • Alias o

    for urn:schemas-microsoft-com:office:office

    - Microsoft Office Open XML General Attributes


XML namespaces allow you to mix different XML formats and avoid conflicts over element names.

Your file can be generated by MS Office (2003) or custom copied content from Office to it. If there are no elements / attributes starting with v:

or o:

in your document, they do nothing.

If the client knows the namespace / format, it can interpret the elements. Not just the browser, but RSS readers, calendars, ... If the client doesn't know the namespace but respects it, he at least knows to ignore the elements / attributes even if they have a name that might be valid in HTML.

+2


source


In HTML5 in mode text/html

it doesn't matter. This is a bug that is interpreted as a named attribute xmlns:v

that does nothing.



In XHTML5 (HTML5 in application/xhtml+xml

) it has the same meaning as in XML: it declares that the prefix v

is for the namespace identified urn:schemas-microsoft-com

, but simply declaring the prefix does nothing.

0


source







All Articles