[xsl] Generate a table in nested form

Subject: [xsl] Generate a table in nested form
From: Rashi Bhardwaj <rashi.bhardwaj@xxxxxxxxx>
Date: Tue, 7 Dec 2010 17:36:36 +0530
I have sample xml in this form:

<a>
			<b name="Name" value="Test"/>
			<b name="Identity" value="      5229"/>
			<b name="Last Change Date" value="4/26/2010"/>
			<b name="Last Change Time" value="11:38 AM"/>
			<b name="Initial Date" value="2/11/2010"/>
			<b name="Initial Time" value="09:37 AM"/>
			<b name="Sections 1-1" value="&quot;Application Usage&quot;
                                                    ">
			</b>
			<b name="QQuestion 1-1" value="how are u"/>
			<b name="RResponse 1-1" value="2 - Disagree"/>
			<b name="CComment 1-1" value="fine"/>
			<b name="Section 1_2" value="test 2"/>
			<b name="Question 1_2" value="how"/>
			<b name="Response 1_2" value="3 "/>
			<b name="Comment 1_2" value="fine2"/>
			<b name="Section 1_3" value="test 3"/>
			<b name="Question 1_3" value="where"/>
			<b name="Response 1_3" value="4"/>
			<b name="Comment 1_3" value="ok"/>
			<b name="Section 1_4" value="test 5"/>
			<b name="Question 1_4" value="when"/>
			<b name="Response 1_4" value="5"/>
			<b name="Comment 1_4" value="okk"/>

I want to generate a table columns heads, Name, identity, last
updation date....so on...but for the Questions there will one column
head 'Question' and all the other question should come under this
column Question in different row.
like
<tr>
<th>Name</th>
<th>Identity</th>
.....
<th>Question</th></tr>
<tr>
<td>Test<td>
<td>5299<td>
........
<td>how are u<td></tr>
<tr>
<td></td>
<td></td>
......
<td>how</td></tr>
.......
All question should come under one column Question in each row.

xsl:

i have used is

<xsl:when test="contains(@name, 'Question')">
<xsl:choose>
<xsl:when test="contains(@name, 'QQuestion')">
<td>
<xsl:value-of select="."/>
</td>
</xsl:when>
<xsl:otherwise>
<tr>
<td/>
<td/>
....
<td>
<xsl:value-of select="."/>
</td>
</tr>
</xsl:otherwise>
</xsl:choose>
</xsl:when>

But it is not creating nested output. Same I have to do for comments,
response and sections.

Please tell me where I m wrong.

Current Thread