I create a dynamic table (grid) using xslt,
I am new to XSLT, I also asked a question before it is XSLT - Creating a dynamic grid, please refer to it. On the top question I use 2 XML for columns and rows, but here I am trying to use only one XML (rows).
You can find XSLT on the above Question with 2 XML sections.
XML data:
<TableData> <Rows> <Row ID="0" Name="A" Link-Name="Yes" Hide-ID="Yes" Sort-Name="Yes"/> <Row ID="1" Name="B" Desc="Some description" Link-Name="Yes" Hide-ID="Yes" Sort-Name="Yes"/> <Row ID="3" Name="C" Link-Name="Yes" Hide-ID="Yes" Sort-Name="Yes"/> </Rows> </TableData>
Expected Result:
<table border="1"> <tbody> <tr> <th> <a onclick="javascript:SortColumn('Item Name')">Item Name</a> </td> <th> Item Description</td> </tr> <tr> <td width="50%"> <a onclick="javascript:OpenDifferentPage('A','0')">A</a> </td> <td width="50%"></td> </tr> <tr> <td width="50%">B</td> <td width="50%">Some description</td> </tr> <tr> <td width="50%">C</td> <td width="50%"></td> </tr> </tbody> </table>
I start at XSLT,
I want to check here that if the attribute "Link-Name" = "yes", then I need to display the data between the binding tag (Name).
I create many complex functions in this column. Therefore, here I can create a template for certain attributes of the column, which is used to display in the grid. Other attributes are for data purposes (the column is 15, but depends on the user's choice, if the user selects 8 columns to display, and must also support ORDERING attributes ) I am ready to create a predefined template for all columns. So is this possible for me?
Thank you for your expectation.
source share