This is my xml input.
Try this to ignore the namespace:
<xsl:template match="*[local-name()='package']">
<xsl:message>Entering package</xsl:message>
</xsl:template>
XSLT understands the namespaces QNames which are defined in input XML.
In addition to the above answer we can give any name to our xsl namespace.
Input xml has definition as xmlns:dc="http://purl.org/dc/elements/1.1/" and elements are defines as dc prefix
You can define a stylesheet below :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:purl="http://purl.org/dc/elements/1.1/"
xmlns:idpf="http://www.idpf.org/2007/opf">
<xsl:template match="idpf:package/purl:language">
<xsl:message>Entering package. Selected Language.</xsl:message>
</xsl:template>
Add the namespaces in your stylesheet.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:opf="http://www.idpf.org/2007/opf">
<xsl:template match="opf:package">
<xsl:message>Entering package</xsl:message>
</xsl:template>