我是XSLT的新手。我想基于 name和rno 匹配属性来显示要解析的xml数据,如下所示。 提前谢谢!
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<parent>
<child>
<name>test1</name>
<rno>101</rno>
<rating>2</rating>
</child>
<child>
<name>test2</name>
<rno>102</rno>
<rating>2</rating>
</child>
<child>
<name>test1</name>
<rno>103</rno>
<rating>2</rating>
</child>
<child>
<name>test1</name>
<rno>101</rno>
<rating>1</rating>
</child>
</parent>
我希望输出如下:
<parent>
<child>
<name>test1</name>
<rno>101</rno>
<sub-grp>
<rating>2</rating>
<rating>1</rating>
<rating>2</rating>
</sub-grp></child><child>
<name>test2</name>
<rno>102</rno>
<rating>2</rating>
</child></parent>