私はここに来たばかりです-そして、あなたたちが最高だと思います-だから、ここに行きます.
これが私の問題です。データベースを使わずに、あえて XML のみに基づいて完全なブログ サイトを作成しました。これまでのところ、私はとてもうまくやっています。このプロジェクトをまとめて完了するのを妨げている問題が 1 つだけあります。
次のような「ブログ コメント」xml ドキュメントがあります。
<comments>
<blogId id="123">
<commentID>46</commentID>
<userName>user1</userName>
<userComment>This is a test comment</userComment>
</blogId>
</comments>
<comments>
<blogId id="123">
<commentID>47</commentID>
<userName>user2</userName>
<userComment>this is a test comment by some user</userComment>
</blogId>
</comments>
<comments>
<blogId id="1244">
<commentID>129</commentID>
<userName>user3</userName>
<userComment>This is someone else's comment</userComment>
</blogId>
</comments>
最初の blogId ノード (?) に添付されたコメントの数をカウントできるようにしたいと考えています。
これまでのところ、ドキュメントを開いて読むことはできますが、数え方がわかりません....