The reason for this difference is that the W3C validator does not seem to perform XHTML processing with the namespace. Although XHTML documents should be in the XHTML namespace, this is actually reasonable because HTML documents do not use namespaces, and the normative legal structure of XHTML documents (like HTML) is defined by a DTD file, and DTDs are not really a namespace .
As @Alochi already noted:
Type identifier values โโMUST match the name production.
This is true when the document is parsed as not a namespace, but it is not true if the document must match the namespace. Namespaces in the XML specification indicate that Identifiers must conform to the NCName statement , which explicitly prohibits the colon character. Known namespace parsing is a general convention, and therefore the use of a colon in the id value is not recommended, even if it is allowed when parsing the document is not a namespace.
Summary: if namespaces are ignored, the ID value must be a valid Name and may contain a colon; otherwise, it must be a valid NCName and cannot contain a colon.
jasso source share