我已经创建了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