I have A XML File that made by a PHP Script:
<?xml version="1.0"?>
<posts><post><id>25</id><title>متن فارسی </title><content>s</content><summary>s</summary></post> <post><id>28</id><title>english text</title><content>1</content> <summary>1</summary></post></posts>
and i'm parsing it using this code in android:
public final String getElementValue( Node elem ) {
Node child;
if( elem != null){
if (elem.hasChildNodes()){
for( child = elem.getFirstChild(); child != null; child = child.getNextSibling() ){
if( child.getNodeType() == Node.TEXT_NODE )
return child.getNodeValue();
}
}
}
return "";
}
when my xml is English(For example post id 28 in this xml) it works well
but when my xml is persian(For example post id 25 in this xml) it returns only first character of text .
how can i handle that problem?