で指定された名前を持つ単一の子要素を取得するのは、私はこのようなXMLがあるとしましょう:鋸山
:<paper>
<header>
</header>
<body>
<paragraph>
</paragraph>
</body>
<conclusion>
</conclusion>
</paper>
を私はちょうどのような醜いループをせずに、conclusion
を得ることができる方法はあります
for child in paper.children do
if child.name == "conclusion"
conclusion = child
end
end
puts conclusion
pythonのElement.find('conclusion')
のようなものが理想的です。
知っている場合は、[このチュートリアル](http://www.nokogiri.org/tutorials/searching_a_xml_html_document.html)を見たことがありますか? 「ノコギリは名前で要素を見つけよう」とグーグルで見つけた – alexanderbird