While XSLT 2.0 supports xpath-default-namespace
to set the namespace URI that is assumed for non-prefixed names, that won't help you here as you need to match a namespaced element that is a child of a non-namespaced one.
You must bind a prefix to http:sps.in
in the stylesheet and then use that in the match expression:
<xsl:stylesheet version="2.0" xmlns="http:sps.in" xmlns:sps="http:sps.in"
exclude-result-prefixes="sps"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- ... -->
<xsl:template match="Datalist/sps:username">
The @nil
should still work as the nil
attribute in your example is not itself in a namespace. If it were xsi:nil
then you would need to bind the xsi
prefix in your stylesheet in the same way.