I have this XML document and I want to find an specific GitHubCommiter using REXML. Hoy do I do that?
<users>
<GitHubCommiter id="Nerian">
<username>name</username>
<password>12345</password>
</GitHubCommiter>
<GitHubCommiter id="xmawet">
<username>name</username>
<password>12345</password>
</GitHubCommiter>
<GitHubCommiter id="JulienChristophe">
<username>name</username>
<password>12345</password>
</GitHubCommiter>
</users>
I have tried:
log = REXML::Document.new(file)
root = log.root username = root.elements["GitHubCommiter['#{github_user_name}']"].elements['username'].text
password = root.elements["GitHubCommiter['#{github_user_name}']"].elements['password'].text
root.elements["GitHubCommiter['id'=>'#{github_user_name}']"].text
But I don't find a way to do it. Any idea?