Possible Duplicate:
XPATH problem with dom4j
I am using dom4j to overwrite a value in the XML. The XML looks like this:
<name color="blue" time="555555">
<element1 param="1">
<value>value1</value>
<value>value2</value>
<value>value3</value>
<element1>
</name>
<name color="blue" time="888888">
<element2 param="1">
<value>value1</value>
<value>value2</value>
<value>value3</value>
<element1>
</name>
I am trying to select nodes by:
SAXReader saxReader = new SAXReader();
Document document = saxReader.read(xmlLocation);
List list= document.selectNodes("//element1/@color/[@time='555555']" );
but the list returns boolean(which is true in this case). I wanted to change all the 3 values where time="555555".
If I do:
List list= document.selectNodes("//element1/@time" );
It returns nodes.(attributes and elements) Isn't there a way to directly go to that node where time is 555555. please help.