我已經創建了XSLT但我還想能夠對數據進行排序,還可以添加某種指數的,所以我可以組項目一起,難度林有就是我想要的節點排序依據包含多個值 - 值id喜歡排序。XSLT - 排序多個值
例如,下面是我的XML:
<item>
<title>Item 1</title>
<subjects>English,Maths,Science,</subjects>
<description>Blah Blah Bah...</description>
</item>
<item>
<title>Item 2</title>
<subjects>Geography,Physical Education</subjects>
<description>Blah Blah Bah...</description>
</item>
<item>
<title>Item 3</title>
<subjects>History, Technology</subjects>
<description>Blah Blah Bah...</description>
</item>
<item>
<title>Item 4</title>
<subjects>Maths</subjects>
<description>Blah Blah Bah...</description>
</item>
所以,如果我排序<subjects>
我得到這樣的順序:
English,Maths,Science,
Geography,Physical Education
History, Technology
Maths
不過,我想這樣的輸出:
English
Geography
History
Maths
Maths
Physical Education
Science
Technology
輸出<subjects>
中包含的每個主題的XML,因此Item1包含主題數學,英語&科學,所以我想輸出標題和描述3次,因爲它與所有3個科目有關。
什麼在XSLT的最好辦法做到這一點?
XSLT 1.0或2.0? – 2009-10-04 00:07:48
這是XSLT 1.0 – CLiown 2009-10-04 10:43:09