0
比方说,我有这个XML软硬度:获取文本节点的唯一路径从XML
<recipes>
<pudate>2011-11-01</pubdate>
<totalNumberOfResults>6</totalNumberOfResults>
<recipe>
<title>Ham And Cheese Omlet Roll Recipe</title>
<href>http://www.grouprecipes.com/38722/ham-and-cheese-omlet-roll.html</href>
<ingredients>cheddar cheese, dijon mustard, eggs, flour, milk, cream cheese, salt, green onion</ingredients>
</recipe>
<recipe>
<title>Egg Noodle Omlet Recipe</title>
<href>http://www.grouprecipes.com/63652/egg-noodle-omlet.html</href>
<ingredients>bacon, cheese, eggs, noodles, onions</ingredients>
</recipe>
<recipe>
<title>Sea Food Omlet Recipe</title>
<href>http://www.grouprecipes.com/8941/sea-food-omlet.html</href>
<ingredients>butter, crab meat, green onion, cheese, salt, capers</ingredients>
</recipe>
<recipe>
<title>French Fry - Tater Tot Omlet Recipe</title>
<href>http://www.grouprecipes.com/20924/french-fry---tater-tot-omlet.html</href>
<ingredients>eggs, french fries, salt, butter</ingredients>
</recipe>
</recipes>
我需要有一个结构,它像这样
/recipes/pubdate
/recipes/totalNumbeOfResults
/recipes/recipe/title
/recipes/recipe/href
/recipes/recipe/ingredients
我认为,必须用递归函数完成。请帮助。