XSLT - Creating Dynamic Grid with single XML

旧街凉风 提交于 2019-12-12 21:44:48

问题


I am creating dynamic table(grid) using xslt,

I am beginner in XSLT, I have also asked question before here it is XSLT - Creating Dynamic Grid please refer it, On Above Question I am using 2 XML for Columns And Rows , But Here i am trying only one XML(Rows).
You can find XSLT on above Question with 2 XML Section.

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 Output:

<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 am beginner in XSLT,

I want to check here that If "Link-Name" attribute ="yes" then i need to display Data in between anchor tag(Name).

I am create many complex functionality on this column. So here can i made template for particular attributes of column which is used to display on grid others attribute are for Data purpose(Column are 15 but it depend on user selection, if user select 8 column for display and also it must maintain ORDER of attributes) I am ready to create pre-defined template for all Columns. So Is it possible for me?

Thank you for your anticipation

来源:https://stackoverflow.com/questions/18104311/xslt-creating-dynamic-grid-with-single-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!