Hi,
This is Parthy.
Am getting this error in XSLT.
Am trying to search the rows by passing parameter from C# 2.0 to XSLT.
Can anyone give me a solution for this prob...
The coding follows:
CS Page:-
XSLT :
This is Parthy.
Am getting this error in XSLT.
Am trying to search the rows by passing parameter from C# 2.0 to XSLT.
Can anyone give me a solution for this prob...
The coding follows:
CS Page:-
Code:
XsltArgumentList xslArg = new XsltArgumentList();
xslArg.AddParam("firstName", "", txtCustomerName.Text);
string xmlPath = @"D:\Project\Parthy\XML_Samples\XML_XSLT\OrdersXML.xml";
ds.WriteXml(xmlPath);
Xml1.TransformSource = @"D:\Project\Parthy\XML_Samples\XML_XSLT\SearchXSL.xsl";
Xml1.TransformArgumentList = xslArg;
Xml1.DocumentSource = xmlPath;
Xml1.DataBind();
XSLT :
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="urn:schemas-microsoft-com:xslt"
extension-element-prefixes="exsl">
<xsl:param name="firstName" select="//Table"/>
<xsl:template match="/">
<html>
<body>
<h2>Orders</h2>
<table border="1">
<tr bgcolor="blue">
<th align="center">Order No</th>
<th align="center">Order Date</th>
<th align="center">First Name</th>
<th align="center">Last Name</th>
<th align="center">Order Amount</th>
<th align="center">Shipping Charge</th>
<th align="center">Shipping Service</th>
<th align="center">Payment Type</th>
<th align="center">Payment Status</th>
<th align="center">Order Status</th>
<th align="center">Phone Verify</th>
</tr>
<xsl:for-each select="exsl:node-set($firstName)/First_x0020_Name">
<tr>
<td>
<xsl:value-of select="Order_x0020_No"/>
</td>
<td>
<xsl:value-of select="Order_x0020_Date"/>
</td>
<td>
<xsl:value-of select="First_x0020_Name"/>
</td>
<td>
<xsl:value-of select="Last_x0020_Name"/>
</td>
<td>
<xsl:value-of select="Order_x0020_Amount"/>
</td>
<td>
<xsl:value-of select="Shipping_x0020_Charge"/>
</td>
<td>
<xsl:value-of select="Payment_x0020_Type"/>
</td>
<td>
<xsl:choose>
<xsl:when test="./Payment_x0020_Status="Y"">
<span style="color:red">
<xsl:value-of select="Payment_x0020_Status"/>
</span>
</xsl:when>
<xsl:otherwise>
<span style="color:green">
<xsl:value-of select="Payment_x0020_Status"/>
</span>
</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:value-of select="Order_x0020_Status"/>
</td>
<td>
<xsl:value-of select="Phone_x0020_Verify"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Comment