我将亚洲保留为父元素。在此之下,我将印度和中国作为子元素。我想通过使用速度代码来获取这两个国家。
下面是我的代码:我正在使用该方法getChildren()
,我只得到第一个孩子,无法得到它的两个孩子。
我有父元素 ascontinent
和子元素 as countries
。
#foreach ($cur_continent in $continent.getSiblings())
#foreach($countries in $cur_continent.getChildren())
$countries.getData()