agentwalker
Programmer
My xml looks something like this
The Dataset elements can have an attribute which is data-cols. This can be any number and denoted the number of columns that should be used to display its child data elements.
So if its data-cols="2" it should be two columns for that data i.e.
<tr>
<td>data1</td><td>data2</td>
</tr>
if it was data-cols="1" then the child data elements need to be 1 col each so would end up like so, over two rows.
<tr>
<td>data1</td>
</tr>
<tr>
<td>data2</td>
</tr>
I'm trying to write the xslt to do that be not getting very far. Any ideas hpw to go about this ?
Cheers
Code:
<group collapse-flagged-groups="Y" collapse-flagged-datasets="Y" css-class="CarePlanProbGroup" javascript-function="highlight(this)">
<dataset collapse-this="Y" data-cols="2">
<data label-text="Created / Modified By:">Jim Davidson On 23 October 2007 23:10</data>
<data label-text="Date Entered:">12 September 2006 12:14</data>
</dataset>
<dataset collapse-this="N">
<data>Is clinically obese, tablet controlled diabetic - oh yeah!</data>
</dataset>
<dataset collapse-this="Y">
<data label-text="Type:">Overweight</data>
</dataset>
<group collapse-this="Y">
<dataset>
<row>
<data label-text="Goal">To ensure client has a full understanding of selected diet - oh yeah!</data>
<data label-text="Interventions / Actions">
Discuss diet in full, give information leaflets
Discuss any difficulties that the client feels they may have with the diet
</data>
<data label-text="Person / Team Responsible">Dietition</data>
<data label-text="Review Date">29 October 2007 29:12</data>
<group collapse-this="N">
<dataset collapse-this="N">
<data label-text="Type:">Diet counselling</data>
</dataset>
<dataset collapse-this="N" data-cols="3">
<data label-text="Entered Date:">12 September 2006 12:14</data>
<data label-text="Update By:">Mike High</data>
<data label-text="Update Date:">23 October 2007 23:10</data>
</dataset>
</group>
</row>
</dataset>
</group>
</group>
<group collapse-flagged-groups="Y" collapse-flagged-datasets="Y" css-class="CarePlanProbGroup">
<dataset collapse-this="Y" data-cols="2">
<data label-text="Created / Modified By:">Jerry Smith On 27 September 2007 27:11</data>
<data label-text="Date Entered:">27 September 2007 27:11</data>
</dataset>
<dataset collapse-this="N">
<data>agafgkaf</data>
</dataset>
<dataset collapse-this="Y">
<data label-text="Type:">Constipation</data>
</dataset>
<group collapse-this="Y">
<dataset>
<row>
<data label-text="Goal">afkasdjfhjk</data>
<data label-text="Interventions / Actions">hadkfhjkasd</data>
<data label-text="Person / Team Responsible">adjkhasdjkhf</data>
<data label-text="Review Date">29 October 2007 29:12</data>
<group collapse-this="N">
<dataset collapse-this="N">
<data label-text="Type:">Goal setting</data>
</dataset>
<dataset collapse-this="N" data-cols="3">
<data label-text="Entered Date:">23 October 2007 23:12</data>
<data label-text="Update By:">Noody Burton</data>
<data label-text="Update Date:">23 October 2007 23:12</data>
</dataset>
</group>
</row>
</dataset>
</group>
<group collapse-this="Y">
<dataset>
<row>
<data label-text="Goal">yep</data>
<data label-text="Interventions / Actions">yep</data>
<data label-text="Person / Team Responsible">yep</data>
<data label-text="Review Date">29 October 2007 29:12</data>
<group collapse-this="N">
<dataset collapse-this="N">
<data label-text="Type:">Diet sheet</data>
</dataset>
<dataset collapse-this="N" data-cols="3">
<data label-text="Entered Date:">27 September 2007 27:11</data>
<data label-text="Update By:">Summer Sams</data>
<data label-text="Update Date:">27 September 2007 27:11</data>
</dataset>
</group>
</row>
</dataset>
</group>
</group>
The Dataset elements can have an attribute which is data-cols. This can be any number and denoted the number of columns that should be used to display its child data elements.
So if its data-cols="2" it should be two columns for that data i.e.
<tr>
<td>data1</td><td>data2</td>
</tr>
if it was data-cols="1" then the child data elements need to be 1 col each so would end up like so, over two rows.
<tr>
<td>data1</td>
</tr>
<tr>
<td>data2</td>
</tr>
I'm trying to write the xslt to do that be not getting very far. Any ideas hpw to go about this ?
Cheers