I have the following xml file:
<resources>
<resource id="res001">
<property name="propA" value="A" />
<property name="propB" value="B" />
</resource>
<resource id="res002">
<property name="propC" value="C" />
<property name="propD" value="D" />
</resource>
<resource id="res003">
<property name="propE" value="E" />
<property name="propF" value="F" />
</resource>
</resources>
How can I do something like this with Java/Xml:
Xml xml = new Xml("my.xml");
Resource res001 = xml.getResouceById("res003");
System.out.println("propF: " + res.getProperty("propF"));
So it prints:
F
I have tried apache commons-configurations XMLConfiguration with XPathExpressionEngine, but I just can't make it work. I have googled and found some examples, but neither would work :( I'm looking for a solution where I don't need to loop through all the elements.
Regards, Alex