Essentially, I want to take a bunch of:
<Cube currency="USD" rate="1.2954"/>
And put them into a hashmap of the format:
String USD, String 1.2954
I have the following Code:
Map<String, String> list = new HashMap<String, String>();
Pattern p = Pattern.compile("<Cube\\scurrency='(.*)'\\srate='(.*)'/>");
Matcher matcher = p.matcher(currency_source);
while (matcher.find()) {
list.put(matcher.group(1)); // PROBLEMATIC
}
I don't know how to properly add the currency and rate to the hashmap.