Am trying to use XSLT for my XML given below -
<?xml version="1.0" encoding="UTF-8"?>
<a:catalog>
<a:cd>
<a:title>Empire Burlesque</a:title>
<a:artist>Bob Dylan</a:artist>
<a:country>USA</a:country>
</a:cd>
<a:cd>
<a:title>Hide your heart</a:title>
<a:artist>Bonnie Tyler</a:artist>
<a:country>UK</a:country>
</a:cd>
</a:catalog>
And below id my XSLT which am trying to run to fetch a:title
and a:artist
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My test XSLT</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th style="text-align:left">Title</th>
<th style="text-align:left">Artist</th>
</tr>
<xsl:for-each select="a:catalog/a:cd">
<tr>
<td><xsl:value-of select="a:title"/></td>
<td><xsl:value-of select="a:artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
In this without namespace I can get output but not with namespace. Or should I write code for remove namespaces from XML ?