I have the below XML and I need to read the attribute "Overall Depth" from the XML file through an XSL file. I am not able to read the value in the XSL file for the condition check
<?xml version="1.0" encoding="UTF-8"?>
<Products xmlns:appliance="http://www.nonamespace/appliance" DateGenerated="06-02-2009 T08:12:21">
<Product ModelNumber="A3316ABSBB">
<DataSource Name="XCAT">
<AttributeGroups>
<AttributeGroup Name="WEIGHTS & DIMENSIONS">
<Attribute Name="Approximate Shipping Weight">163</Attribute>
<Attribute Name="Net Weight (lbs.)">144</Attribute>
<Attribute Name="Overall Height">61.75</Attribute>
<Attribute Name="Overall Width">28</Attribute>
<Attribute Name="Overall Depth">29.125</Attribute>
<Attribute Name="Case Depth Without Door (in.)">25-7/8</Attribute>
<Attribute Name="Depth with Door Open 90° (in.)">54-7/8</Attribute>
<Attribute Name="Depth Without Handle (in.)">29-1/8</Attribute>
<Attribute Name="Height to Mid-Freezer">51-3/8</Attribute>
<Attribute Name="Height to Top of Case (in.)">61-1/4</Attribute>
<Attribute Name="Width w/Door Open 90 Degrees Incl. Handle (in.)">30-1/2</Attribute>
<Attribute Name="Width w/Door Open 90 Degrees Less Handle (in.)">28-5/8</Attribute>
<Attribute Name="Back Air Clearances (in.)">1</Attribute>
<Attribute Name="Side Air Clearances (in.)">3/4</Attribute>
<Attribute Name="Top Air Clearances (in.)">1</Attribute>
</AttributeGroup>
</AttributeGroups>
</DataSource>
</Product>
</Products>
Below is my XSL file:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xslt"
xmlns:dyn="http://exslt.org/dynamic"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:common="http://exslt.org/common"
xmlns:fn="http://functions"
xmlns:redirect="http://xml.apache.org/xalan/redirect"
extension-element-prefixes="xalan redirect fn dyn date"
version="1.0">
<xsl:import href="common-functions.xsl"/>
<xsl:variable name="mapping-file" select="'mapping/uccnet-mapping.xml'"/>
<xsl:variable name="attribute-mapping" select="document($mapping-file)/AttributeMappings" />
<xsl:variable name="model-file" select="'../trigger/inputxml/trigger.xml'"/>
<xsl:variable name="model-mapping" select="document($model-file)/Trigger/Products" />
<xsl:param name="delimiter" select="','"/>
<xsl:variable name = "marketGln">,marketGLN,publicationType</xsl:variable>
<xsl:param name="delivery-report-file"/>
<xsl:param name = "market_gln" />
<xsl:strip-space elements="*" />
<xsl:output method="text"/>
<xsl:template match="/Products">
<xsl:variable name="filter-by-valid-sku"
select="Product[DataSource[@Name='XCAT']/BasicAttributes[Attribute[@Name='RELEASEDATE']!='' and
Attribute[@Name='DESCRIPTION']!='' and Attribute[@Name='UDEXCODE']!='']]"/>
<xsl:call-template name = "print-header"/>
<!-- Print Content -->
<xsl:for-each select = "$filter-by-valid-sku">
<xsl:variable name = "ModelNumber" select="$model-mapping/Product/SKU" />
<xsl:if test="@ModelNumber =$ModelNumber">
<xsl:if test="Product[DataSource[@Name='XCAT']/AttributeGroups/AttributeGroup[@Name='WEIGHTS & DIMENSIONS']/Attribute[@Name='Overall Depth']] !=''">
<xsl:call-template name="print-content">
<xsl:with-param name="aggr-sku-data" select="." />
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- Print Content -->
<xsl:template name = "print-header">
<xsl:for-each select="$attribute-mapping/Mapping">
<xsl:value-of select="normalize-space(@Name)"/>
<xsl:choose>
<xsl:when
test = "position()!=last()">
<xsl:value-of select="$delimiter" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$marketGln" />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template name= "print-content">
<xsl:param name="aggr-sku-data" />
<xsl:for-each select="$attribute-mapping/Mapping">
<xsl:variable name="attribute-value">
<xsl:choose>
<xsl:when test="@source='hardcode'">
<xsl:value-of select="text()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="dyn:evaluate(text())"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test ="$attribute-value!=''">
<xsl:value-of select="normalize-space($attribute-value)"/>
</xsl:if>
<xsl:choose>
<xsl:when test = "position()!=last()">
<xsl:value-of select="$delimiter" />
</xsl:when>
<xsl:otherwise>
<xsl:text>,</xsl:text>
<xsl:value-of select="$market_gln"/>
<xsl:value-of select="$delimiter" />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
But I am not able to read the value in the XSL file for the condition check.
Thanks in advance
regards
Prashanth