HTML Guides for xslt
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
The xmlns:pcm attribute is an XML namespace declaration, and HTML doesn't allow prefixed namespace declarations on any element.
In XML, xmlns:pcm="urn:PageContentManager" binds the prefix pcm to that namespace, so names like pcm:item can appear inside the element. The HTML parser doesn't process namespace declarations. It keeps xmlns:pcm as a plain attribute with a colon in its name. The only namespace attribute an HTML element may have is xmlns, with the exact value http://www.w3.org/1999/xhtml. The validator reports xmlns:pcm wherever it appears, <html> included.
The attribute shows up in pages built with XSLT, such as SharePoint web parts. When an XSLT stylesheet writes out a literal element, it copies the namespace declarations in scope onto that element, except for the XSLT namespace itself and any prefix listed in exclude-result-prefixes. If you can edit the stylesheet, add pcm to that list:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pcm="urn:PageContentManager"
exclude-result-prefixes="pcm">
Browsers do nothing with the attribute, so removing it doesn't change how the page looks or works.
Invalid example
<div class="news-list" xmlns:pcm="urn:PageContentManager">
<ul>
<li><a href="/news/opening-hours">Opening hours change</a></li>
</ul>
</div>
Valid example
<div class="news-list">
<ul>
<li><a href="/news/opening-hours">Opening hours change</a></li>
</ul>
</div>
The xmlns:style attribute declares an XML namespace prefix, and HTML elements don't accept namespace declarations other than xmlns itself.
In XML, xmlns:style="..." binds the prefix style to a namespace URI, so the document can use names like style:font. The HTML parser doesn't process namespace declarations. It reads xmlns:style as an ordinary attribute with an unusual name and does nothing with it. The one namespace attribute an HTML element may have is xmlns, and only with the exact value http://www.w3.org/1999/xhtml. The validator rejects prefixed declarations like xmlns:style on every HTML element, <html> included.
The attribute usually comes from markup generated with XML tools. An XSLT stylesheet, for example, copies the namespace declarations in scope onto each literal element it outputs, unless the prefix is listed in exclude-result-prefixes:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:style="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="style">
When a template repeats the declaration on the same element, the validator also reports a duplicate attribute error. Removing xmlns:style fixes both, and the page renders the same because the attribute has no effect in browsers.
Invalid example
<div class="top-bar" xmlns:style="http://www.w3.org/1999/xhtml">
<a href="/">Home</a>
</div>
Valid example
<div class="top-bar">
<a href="/">Home</a>
</div>
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
1K Weekly
1,000 monthly checks. Cancel anytime.
Get 1K Weekly →Join teams across 40+ countries