2
我想寫入xslt來獲取輸入xml的響應。提前致謝。我想將產出分組,以便每個員工詳細信息不重複月份組合。按月份和年份組合的組響應
輸入XML:
<resultset>
<row>
<column>
<name>Month</name>
<value>2</value>
</column>
<column>
<name>Year</name>
<value>2010</value>
</column>
<column>
<name>EmpName</name>
<value>Anu</value>
</column>
<column>
<name>Age</name>
<value>24</value>
</column>
</row>
<row>
<column>
<name>Month</name>
<value>2</value>
</column>
<column>
<name>Year</name>
<value>2010</value>
</column>
<column>
<name>EmpName</name>
<value>Nancy</value>
</column>
<column>
<name>Age</name>
<value>26</value>
</column>
</row>
<row>
<column>
<name>Month</name>
<value>3</value>
</column>
<column>
<name>Year</name>
<value>2010</value>
</column>
<column>
<name>EmpName</name>
<value>Ned</value>
</column>
<column>
<name>Age</name>
<value>25</value>
</column>
</row>
</resultset>
輸出預計:
<Response>
<PeriodInfo>
<Month>2</Month>
<Year>2010</Year>
<EmployeeDetails>
<Name>Anu</Name>
<Age>24</Age>
</EmployeeDetails>
<EmployeeDetails>
<Name>Nancy</Name>
<Age>26</Age>
</EmployeeDetails>
</PeriodInfo>
<PeriodInfo>
<Month>3</Month>
<Year>2010</Year>
<EmployeeDetails>
<Name>Ned</Name>
<Age>25</Age>
</EmployeeDetails>
</PeriodInfo>
</Response>
+1好答案。 – 2011-01-09 22:59:16