【发布时间】:2016-04-28 17:09:34
【问题描述】:
我想知道是否有人可以提供帮助,我确信这是一件非常简单的事情,但我现在已经“谷歌”了这么多,发现了一些对我不起作用的结果。
基本上我有一个xml文件(data.xml),结构如下
<data>
<food>
<name>Belgian Waffles</name>
<group>waffle</group>
<price>$5.95</price>
<description>Two of our famous Belgian Waffles with plenty of real maple syrup</description>
<calories>650</calories>
</food>
<food>
<name>Strawberry Belgian Waffles</name>
<group>waffle</group>
<price>$7.95</price>
<description>Light Belgian waffles covered with strawberries and whipped cream</description>
<calories>900</calories>
</food>
<food>
<name>Berry-Berry Belgian Waffles</name>
<group>waffle</group>
<price>$8.95</price>
<description>Light Belgian waffles covered with an assortment of fresh berries and whipped cream</description>
<calories>900</calories>
</food>
<food>
<name>French Toast</name>
<group>Toast</group>
<price>$4.50</price>
<description>Thick slices made from our homemade sourdough bread</description>
<calories>600</calories>
</food>
<food>
<name>Homestyle Breakfast</name>
<group>Toast</group>
<price>$6.95</price>
<description>Two eggs, bacon or sausage, toast, and our ever-popular hash browns</description>
<calories>950</calories>
</food>
</data>
所以我想做的是显示按“组”分组的数据,并按父子字母顺序排序,如下所示
Waffle
Belgian Waffles
Berry-Berry Belgian Waffles
Strawberry Belgian Waffles
...
Toast
French Toast
Homestyle Breakfast
...
我将使用 html、jQuery/ajax、data.xml 文件
希望有人能帮助一个完整的n00b!
提前致谢
【问题讨论】: