希望你做得很好 我有一種情況,我從那個是平的服務的結果集結構 這個結果集經理,他的項目和活動中的每個項目XSLT - 組2級
我想改造這個扁平結構,以XML是
Grouped by Manager
Grouped by Project
Activities in that Project
這裏是XML,我有
<Results>
<Result>
<ActivityId>101</ActivityId>
<ActivityName>T1</ActivityName>
<ProjectId>1001</ProjectId>
<ProjectName>Prj1</ProjectName>
<Description>some desc</Description>
<manager>jcooper</manager>
</Result>
<Result>
<ActivityId>102</ActivityId>
<ActivityName>T2</ActivityName>
<ProjectId>1002</ProjectId>
<ProjectName>Prj2</ProjectName>
<Description>some desc</Description>
<manager>jstein</manager>
</Result>
<Result>
<ActivityId>103</ActivityId>
<ActivityName>T3</ActivityName>
<ProjectId>1001</ProjectId>
<ProjectName>Prj1</ProjectName>
<Description>some desc</Description>
<manager>jcooper</manager>
</Result>
<Result>
<ActivityId>104</ActivityId>
<ActivityName>T4</ActivityName>
<ProjectId>1002</ProjectId>
<ProjectName>Prj2</ProjectName>
<Description>some desc</Description>
<manager>jcooper</manager>
</Result>
<Result>
<ActivityId>105</ActivityId>
<ActivityName>T5</ActivityName>
<ProjectId>1002</ProjectId>
<ProjectName>Prj2</ProjectName>
<Description>some desc</Description>
<manager>jstein</manager>
</Result>
</Results>
在這個什麼, 經理jcooper具有Prj1 {已經活動T1,T3},並Prj2 {已經活動T4} 經理jstein具有Prj1(具有活性T2)和prj2 {已經活動T5}
這裏是我想要的格式爲
Manager
List of Prjs
List of Activities in corresponding Project
<Results>
<ManagerWiseResult>
<Manager>jcooper</Manager>
<Project>
<ProjectId>1001</ProjectId>
<ProjectName>Prj1</ProjectName>
<Activities> <!--Activities in Project1 -->
<IndActivity>
<ActivityId>101</ActivityId>
<ActivityName>T1</ActivityName>
</IndActivity>
<IndActivity>
<ActivityId>103</ActivityId>
<ActivityName>T2</ActivityName>
</IndActivity>
</Activities>
</Project>
<Project>
<ProjectId>1002</ProjectId>
<ProjectName>Prj2</ProjectName>
<Activities>
<IndActivity>
<ActivityId>104</ActivityId>
<ActivityName>T4</ActivityName>
</IndActivity>
</Activities>
</Project>
</ManagerWiseResult>
<ManagerWiseResult>
<Project>
<ProjectId>1001</ProjectId>
<ProjectName>Prj1</ProjectName>
<Activities>
<IndActivity>
<ActivityId>102</ActivityId>
<ActivityName>T2</ActivityName>
</IndActivity>
</Activities>
</Project>
<Project>
<ProjectId>1002</ProjectId>
<ProjectName>Prj2</ProjectName>
<Activities>
<IndActivity>
<ActivityId>105</ActivityId>
<ActivityName>T5</ActivityName>
</IndActivity>
</Activities>
</Project>
</ManagerWiseResult>
</Results>
我想弄清楚一個解決方案,但不能。 專家,請你在這方面幫助我。
由於事先 拉維
您僅限於使用XSLT 1.0嗎?或者你可以使用2.0的設施嗎? – Borodin 2013-05-06 19:19:22
我可以使用XSLT 2.0。 你介意看看我的評論,並幫助我與2.0語法。在此先謝謝 – user2350784 2013-05-06 20:13:01