こんにちは私はLibXMLを使ってRSSフィードを解析していますが、ドットシンタックスを使用してコンテンツにアクセスすることが可能かどうかは疑問です。私が持っている場合ドット構文を使用してxmlオブジェクトのコンテンツにアクセスできますか?
だから:
<post>
<created_at>Sat Aug 09 05:38:12 +0000 2008</created_at>
<id>882281424</id>
<text>I so just thought the guy lighting the Olympic torch was falling when he began to run on the wall. Wow that would have been catastrophic.</text>
<source>web</source>
<truncated>false</truncated>
<in_reply_to_status_id></in_reply_to_status_id>
<in_reply_to_user_id></in_reply_to_user_id>
</post>
は、私が最も簡単な方法は、XPathを使用することです
text = post.text
はこれをテストし、それが(固定タイプミスで)正常に動作します。 XMLに ' ... 'しか含まれていない場合は、ループする必要はありません。単に 'puts posts.text'を実行してください。 –
dbr