The following XSLT perfectly selects nodes from the given XML when the namespace xmlns="http://tempuri.org/BaseSchema"
is not present.
Issue : When the namespace xmlns="http://tempuri.org/BaseSchema"
is present in the XML, as is the case for the real problem, the XSLT selects everything from the XML and not the nodes as mentioned in XSLT.
The input file cannot be modified to remove the namespace. Does anyone know how to ignore or suppress the effect of the namespace.
XML
<event xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/BaseSchema" >
<name>Pancake</name>
<categories>
<category>community</category>
</categories>
<venue>
<name>fatzcafe</name>
<city>NYC</city>
<venue_type>
<name>Lounge</name>
<cuisine>Thai</cuisine>
</venue_type>
</venue>
</event>
XSLT
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/BaseSchema">
<xsl:output method="text" encoding="UTF-8" />
<xsl:template match="/event">
<xsl:apply-templates select="venue/venue_type"/>
</xsl:template>
<xsl:template match="/venue_type">
<xsl:value-of select="name" />
<xsl:value-of select="cuisine" />
</xsl:template>
</xsl:stylesheet>