V
vunet.us
I am new to Java. I need to rewrite a function which gets XML elements
text as shown below to get elements value instead:
private String getCharacterDataFromElement(Element e){
Node child = e.getFirstChild();
if(child instanceof CharacterData){
CharacterData cd = (Character) child;
return cd.getData();
}
return "?";
}
<xml>FUNCTION ABOVE GETS THIS<xml>
<xml value="NEED TO GET THIS VALUE"></xml>
THANKS TO ALL.
text as shown below to get elements value instead:
private String getCharacterDataFromElement(Element e){
Node child = e.getFirstChild();
if(child instanceof CharacterData){
CharacterData cd = (Character) child;
return cd.getData();
}
return "?";
}
<xml>FUNCTION ABOVE GETS THIS<xml>
<xml value="NEED TO GET THIS VALUE"></xml>
THANKS TO ALL.