XSLT (rightly) distinguishes between element names with no namespace qualifier (which are processed as belonging in the "no namespace" namespace) and names with an explicit qualifier, which of course are treated as belonging to that namespace.
The solution is to
- declare a prefix for the source document's namespace(s) in the XSLT document node, like (e.g.)
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"> - use these prefixes in your patterns, like (e.g.)
<xsl:template match="xhtml:p">
My thanks to Jeni Tennison for explaining it very clearly in this post.