XML parsing/mapping?

I have a problem parsing/mapping a xml response from a API.

I would like to get the id numer of a keyword when the keyword.text is
like ‘Engels’

So i would like search in the xml response for the text ‘Engels’ than
i would like to have the ‘href’ that belongs to that keyword. In this
case http://www.wrts.nl/api/keywords/84576, i actually only need the
id numer because than i can make a new request to the api with that
information.

The xml-response looks like this:

<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n

<keyword href=“http://www.wrts.nl/api/keywords/83212”>Duits
\n
<keyword href=“http://www.wrts.nl/api/keywords/84576”>Engels</
keyword>\n
<keyword href=“http://www.wrts.nl/api/keywords/84562”>Franconville</
keyword>\n
<keyword href=“http://www.wrts.nl/api/keywords/83711”>Frans
\n
<keyword href=“http://www.wrts.nl/api/keywords/108275”>FRvmbo1ldt</
keyword>\n
<keyword href=“http://www.wrts.nl/api/keywords/85763”>Groep 4</
keyword>\n
<keyword href=“http://www.wrts.nl/api/keywords/84571”>Kapitel 1</
keyword>\n
<keyword href=“http://www.wrts.nl/api/keywords/83213”>klas 2</
keyword>\n
<keyword href=“http://www.wrts.nl/api/keywords/84563”>Leerjaar 1</
keyword>\n
<keyword href=“http://www.wrts.nl/api/keywords/84570”>leerjaar 1 h/
v\n
<keyword href=“http://www.wrts.nl/api/keywords/84572”>Lektion 1</
keyword>\n
<keyword href=“http://www.wrts.nl/api/keywords/83725”>Uitgever</
keyword>\n
<keyword href=“http://www.wrts.nl/api/keywords/84578”>unit 1</
keyword>\n
<keyword href=“http://www.wrts.nl/api/keywords/84564”>Unit\xC3\xA9
1\n
<keyword href=“http://www.wrts.nl/api/keywords/85762”>Woordpakket
1a\n
\n"

How should i do this? Do i need to parse the xml first, or is there a
way to search in the xml directly?

Thank you in advance,
Regards Lasse

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs